Skip to content

Commit

Permalink
fix: don't perform image extraction jobs on invalid images
Browse files Browse the repository at this point in the history
  • Loading branch information
raphael0202 committed Dec 26, 2022
1 parent 09862f1 commit 02458c4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion robotoff/workers/tasks/import_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,11 @@ def run_import_image_job(
return

with db:
save_image(barcode, source_image, product, server_domain)
image_model = save_image(barcode, source_image, product, server_domain)

if image_model is None:
# The image is invalid, no need to perform image extraction jobs
return

enqueue_job(
import_insights_from_image,
Expand Down

0 comments on commit 02458c4

Please sign in to comment.