@@ -569,6 +569,30 @@ impl AsyncStorage {
569
569
Ok ( alg)
570
570
}
571
571
572
+ // Store file without compressing, assumes it's already compressed
573
+ #[ instrument( skip( self , content) ) ]
574
+ pub ( crate ) async fn store_one_uncompressed (
575
+ & self ,
576
+ path : impl Into < String > + std:: fmt:: Debug ,
577
+ content : impl Into < Vec < u8 > > ,
578
+ ) -> Result < ( ) > {
579
+ let path = path. into ( ) ;
580
+ let content = content. into ( ) ;
581
+ let mime = detect_mime ( & path) . to_owned ( ) ;
582
+
583
+ self . store_inner ( vec ! [ Blob {
584
+ path,
585
+ mime,
586
+ content,
587
+ compression: None ,
588
+ // this field is ignored by the backend
589
+ date_updated: Utc :: now( ) ,
590
+ } ] )
591
+ . await ?;
592
+
593
+ Ok ( ( ) )
594
+ }
595
+
572
596
async fn store_inner ( & self , batch : Vec < Blob > ) -> Result < ( ) > {
573
597
match & self . backend {
574
598
StorageBackend :: Database ( db) => db. store_batch ( batch) . await ,
@@ -777,6 +801,16 @@ impl Storage {
777
801
self . runtime . block_on ( self . inner . store_one ( path, content) )
778
802
}
779
803
804
+ #[ instrument( skip( self , content) ) ]
805
+ pub ( crate ) async fn store_one_uncompressed (
806
+ & self ,
807
+ path : impl Into < String > + std:: fmt:: Debug ,
808
+ content : impl Into < Vec < u8 > > ,
809
+ ) -> Result < ( ) > {
810
+ self . runtime
811
+ . block_on ( self . inner . store_one_uncompressed ( path, content) )
812
+ }
813
+
780
814
/// sync wrapper for the list_prefix function
781
815
/// purely for testing purposes since it collects all files into a Vec.
782
816
#[ cfg( test) ]
0 commit comments