File tree Expand file tree Collapse file tree 5 files changed +6
-17
lines changed Expand file tree Collapse file tree 5 files changed +6
-17
lines changed Original file line number Diff line number Diff line change @@ -302,7 +302,6 @@ impl Blobs {
302302 ExportBaoRequest {
303303 hash : hash. into ( ) ,
304304 ranges : ranges. into ( ) ,
305- create_if_missing : false ,
306305 } ,
307306 32 ,
308307 )
Original file line number Diff line number Diff line change @@ -222,7 +222,6 @@ pub struct ObserveRequest {
222222pub struct ExportBaoRequest {
223223 pub hash : Hash ,
224224 pub ranges : ChunkRanges ,
225- pub create_if_missing : bool ,
226225}
227226
228227/// Export the given ranges as chunkks, without validation.
Original file line number Diff line number Diff line change @@ -420,14 +420,14 @@ impl Remote {
420420 let opts = ExportBaoOptions {
421421 hash : root,
422422 ranges : bitfield. ranges . clone ( ) ,
423- create_if_missing : true ,
424423 } ;
425424 let bao = self . store ( ) . export_bao_with_opts ( opts, 32 ) ;
426425 let mut by_index = BTreeMap :: new ( ) ;
427426 let mut stream = bao. hashes_with_index ( ) ;
428427 while let Some ( item) = stream. next ( ) . await {
429- let ( index, hash) = item?;
430- by_index. insert ( index, hash) ;
428+ if let Ok ( ( index, hash) ) = item {
429+ by_index. insert ( index, hash) ;
430+ }
431431 }
432432 let mut bitfields = BTreeMap :: new ( ) ;
433433 let mut hash_seq = BTreeMap :: new ( ) ;
Original file line number Diff line number Diff line change @@ -1028,7 +1028,7 @@ async fn export_ranges_impl(
10281028
10291029#[ instrument( skip_all, fields( hash = %cmd. hash_short( ) ) ) ]
10301030async fn export_bao ( mut cmd : ExportBaoMsg , ctx : HashContext ) {
1031- match ctx. get_maybe_create ( cmd. hash , cmd . create_if_missing ) . await {
1031+ match ctx. get_maybe_create ( cmd. hash , false ) . await {
10321032 Ok ( handle) => {
10331033 if let Err ( cause) = export_bao_impl ( cmd. inner , & mut cmd. tx , handle) . await {
10341034 cmd. tx
Original file line number Diff line number Diff line change @@ -190,20 +190,11 @@ impl Actor {
190190 self . spawn ( import_path ( cmd) ) ;
191191 }
192192 Command :: ExportBao ( ExportBaoMsg {
193- inner :
194- ExportBaoRequest {
195- hash,
196- ranges,
197- create_if_missing,
198- } ,
193+ inner : ExportBaoRequest { hash, ranges } ,
199194 tx,
200195 ..
201196 } ) => {
202- let entry = if create_if_missing {
203- Some ( self . get_or_create_entry ( hash) )
204- } else {
205- self . get ( & hash)
206- } ;
197+ let entry = self . get ( & hash) ;
207198 self . spawn ( export_bao ( entry, ranges, tx) )
208199 }
209200 Command :: ExportPath ( cmd) => {
You can’t perform that action at this time.
0 commit comments