File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -450,6 +450,12 @@ pub struct CleanupLocksResult {
450
450
// TODO: pub resolved_locks: usize,
451
451
}
452
452
453
+ impl CleanupLocksResult {
454
+ fn has_error ( & self ) -> bool {
455
+ self . key_error . is_some ( ) || self . region_error . is_some ( )
456
+ }
457
+ }
458
+
453
459
impl Clone for CleanupLocksResult {
454
460
fn clone ( & self ) -> Self {
455
461
Self {
@@ -478,8 +484,14 @@ impl Merge<CleanupLocksResult> for Collect {
478
484
input
479
485
. into_iter ( )
480
486
. fold ( Ok ( CleanupLocksResult :: default ( ) ) , |acc, x| {
487
+ let new_ret = x?;
488
+ let new_lock_cnt = if new_ret. has_error ( ) {
489
+ 0
490
+ } else {
491
+ new_ret. meet_locks
492
+ } ;
481
493
Ok ( CleanupLocksResult {
482
- meet_locks : acc?. meet_locks + x? . meet_locks ,
494
+ meet_locks : acc?. meet_locks + new_lock_cnt ,
483
495
..Default :: default ( )
484
496
} )
485
497
} )
You can’t perform that action at this time.
0 commit comments