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:
Kenny Lee Sin Cheong 2017-06-02 12:28:17 -04:00
parent 203c0b76e0
commit b5f8e7e24d

View file

@ -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)