Change sec scan candidate query to match parents to the expected version only

This commit is contained in:
Joseph Schorr 2016-02-09 22:23:48 +02:00
parent aef651a7ad
commit 4e771e667f

View file

@ -430,7 +430,7 @@ def get_secscan_candidates(engine_version, batch_size):
ParentImageStorage = ImageStorage.alias()
rimages = []
# Collect the images without parents
# Collect the images without parents.
candidates = list(Image
.select(Image.id)
.join(ImageStorage)
@ -455,7 +455,7 @@ def get_secscan_candidates(engine_version, batch_size):
.switch(Image)
.join(ImageStorage)
.where(Image.security_indexed_engine < engine_version,
Parent.security_indexed_engine >= engine_version,
Parent.security_indexed_engine == engine_version,
ImageStorage.uploading == False)
.limit(batch_size*10))