From b5f8e7e24d4169aa89665cf3df724c8fa3773221 Mon Sep 17 00:00:00 2001 From: Kenny Lee Sin Cheong Date: Fri, 2 Jun 2017 12:28:17 -0400 Subject: [PATCH] Returning from the method instead of calling sleep Simply returning from the method will give DEFAULT_INDEXING_INTERVAL seconds before the next scan operation. --- workers/securityworker.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workers/securityworker.py b/workers/securityworker.py index 0eb6bbe4f..662f19c5c 100644 --- a/workers/securityworker.py +++ b/workers/securityworker.py @@ -74,7 +74,7 @@ class SecurityWorker(Worker): logger.info('Another worker pre-empted us for layer: %s', candidate.id) abt.set() except APIRequestFailure: - time.sleep(DEFAULT_INDEXING_INTERVAL) + return unscanned_images_gauge.Set(num_remaining)