Returning from the method instead of calling sleep
Simply returning from the method will give DEFAULT_INDEXING_INTERVAL seconds before the next scan operation.
This commit is contained in:
parent
203c0b76e0
commit
b5f8e7e24d
1 changed files with 1 additions and 1 deletions
|
@ -74,7 +74,7 @@ class SecurityWorker(Worker):
|
||||||
logger.info('Another worker pre-empted us for layer: %s', candidate.id)
|
logger.info('Another worker pre-empted us for layer: %s', candidate.id)
|
||||||
abt.set()
|
abt.set()
|
||||||
except APIRequestFailure:
|
except APIRequestFailure:
|
||||||
time.sleep(DEFAULT_INDEXING_INTERVAL)
|
return
|
||||||
|
|
||||||
unscanned_images_gauge.Set(num_remaining)
|
unscanned_images_gauge.Set(num_remaining)
|
||||||
|
|
||||||
|
|
Reference in a new issue