workers.securityworker: simplify min id

This commit is contained in:
Jimmy Zelinskie 2017-03-03 14:50:53 -05:00
parent 591e700892
commit b9ac2b7b3b
3 changed files with 8 additions and 10 deletions

View file

@ -33,7 +33,8 @@ class SecurityWorker(Worker):
self._analyzer = LayerAnalyzer(app.config, secscan_api)
# Get the ID of the first image we want to analyze.
self._min_id = get_min_id_for_sec_scan(self._target_version)
self._min_id = app.config.get('SECURITY_SCANNER_INDEXING_MIN_ID',
get_min_id_for_sec_scan(self._target_version))
interval = app.config.get('SECURITY_SCANNER_INDEXING_INTERVAL', DEFAULT_INDEXING_INTERVAL)
self.add_operation(self._index_images, interval)
@ -42,7 +43,7 @@ class SecurityWorker(Worker):
def _index_images(self):
def batch_query():
return get_images_eligible_for_scan(self._target_version, app.config.get('SECURITY_SCANNER_INDEXING_MIN_ID', None))
return get_images_eligible_for_scan(self._target_version)
# Get the ID of the last image we can analyze. Will be None if there are no images in the
# database.