yapf
This commit is contained in:
parent
1ddb09ac11
commit
27ed3bedcc
5 changed files with 9 additions and 7 deletions
|
@ -5,10 +5,8 @@ from data.model.image import (get_images_eligible_for_scan, get_image_pk_field,
|
|||
get_max_id_for_sec_scan, get_min_id_for_sec_scan)
|
||||
from util.migrate.allocator import yield_random_entries
|
||||
|
||||
from workers.securityworker.models_interface import (
|
||||
ScanToken,
|
||||
SecurityWorkerDataInterface
|
||||
)
|
||||
from workers.securityworker.models_interface import (ScanToken, SecurityWorkerDataInterface)
|
||||
|
||||
|
||||
class PreOCIModel(SecurityWorkerDataInterface):
|
||||
def candidates_to_scan(self, target_version, start_token=None):
|
||||
|
@ -34,7 +32,7 @@ class PreOCIModel(SecurityWorkerDataInterface):
|
|||
return (None, None)
|
||||
|
||||
# 4^log10(total) gives us a scalable batch size into the billions.
|
||||
batch_size = int(4 ** log10(max(10, max_id - min_id)))
|
||||
batch_size = int(4**log10(max(10, max_id - min_id)))
|
||||
|
||||
# TODO: Once we have a clean shared NamedTuple for Images, send that to the secscan analyzer
|
||||
# rather than the database Image itself.
|
||||
|
@ -43,8 +41,7 @@ class PreOCIModel(SecurityWorkerDataInterface):
|
|||
get_image_pk_field(),
|
||||
batch_size,
|
||||
max_id,
|
||||
min_id,
|
||||
)
|
||||
min_id,)
|
||||
|
||||
return (iterator, ScanToken(max_id + 1))
|
||||
|
||||
|
|
Reference in a new issue