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 {
302
302
ExportBaoRequest {
303
303
hash : hash. into ( ) ,
304
304
ranges : ranges. into ( ) ,
305
- create_if_missing : false ,
306
305
} ,
307
306
32 ,
308
307
)
Original file line number Diff line number Diff line change @@ -222,7 +222,6 @@ pub struct ObserveRequest {
222
222
pub struct ExportBaoRequest {
223
223
pub hash : Hash ,
224
224
pub ranges : ChunkRanges ,
225
- pub create_if_missing : bool ,
226
225
}
227
226
228
227
/// Export the given ranges as chunkks, without validation.
Original file line number Diff line number Diff line change @@ -420,14 +420,14 @@ impl Remote {
420
420
let opts = ExportBaoOptions {
421
421
hash : root,
422
422
ranges : bitfield. ranges . clone ( ) ,
423
- create_if_missing : true ,
424
423
} ;
425
424
let bao = self . store ( ) . export_bao_with_opts ( opts, 32 ) ;
426
425
let mut by_index = BTreeMap :: new ( ) ;
427
426
let mut stream = bao. hashes_with_index ( ) ;
428
427
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
+ }
431
431
}
432
432
let mut bitfields = BTreeMap :: new ( ) ;
433
433
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(
1028
1028
1029
1029
#[ instrument( skip_all, fields( hash = %cmd. hash_short( ) ) ) ]
1030
1030
async 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 {
1032
1032
Ok ( handle) => {
1033
1033
if let Err ( cause) = export_bao_impl ( cmd. inner , & mut cmd. tx , handle) . await {
1034
1034
cmd. tx
Original file line number Diff line number Diff line change @@ -190,20 +190,11 @@ impl Actor {
190
190
self . spawn ( import_path ( cmd) ) ;
191
191
}
192
192
Command :: ExportBao ( ExportBaoMsg {
193
- inner :
194
- ExportBaoRequest {
195
- hash,
196
- ranges,
197
- create_if_missing,
198
- } ,
193
+ inner : ExportBaoRequest { hash, ranges } ,
199
194
tx,
200
195
..
201
196
} ) => {
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) ;
207
198
self . spawn ( export_bao ( entry, ranges, tx) )
208
199
}
209
200
Command :: ExportPath ( cmd) => {
You can’t perform that action at this time.
0 commit comments