File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -414,7 +414,24 @@ def _should_choose_other_blocks(self) -> bool:
414
414
return False
415
415
416
416
module_infos = get_remote_module_infos (self .dht , self .module_uids , latest = True )
417
- return block_selection .should_choose_other_blocks (self .dht .peer_id , module_infos , self .balance_quality )
417
+ should_choose = block_selection .should_choose_other_blocks (self .dht .peer_id , module_infos , self .balance_quality )
418
+
419
+ if False == should_choose :
420
+ return False
421
+ else :
422
+ for i in range (2 ):
423
+ wait_time = 90 + random .randint (- 30 , 10 )
424
+ time .sleep (wait_time )
425
+
426
+ module_infos = get_remote_module_infos (self .dht , self .module_uids , latest = True )
427
+ logger .info ('--retrying should_choose_other_blocks' )
428
+ should_choose = block_selection .should_choose_other_blocks (self .dht .peer_id , module_infos , self .balance_quality )
429
+
430
+ if False == should_choose :
431
+ return False
432
+
433
+ return should_choose
434
+
418
435
419
436
def shutdown (self , timeout : Optional [float ] = 5 ):
420
437
self .stop .set ()
You can’t perform that action at this time.
0 commit comments