diff --git a/docker-compose.yml b/docker-compose.yml index e5c0735960..4ccdb6fe51 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -79,6 +79,7 @@ services: depends_on: - postgres - redis + - elasticsearch update-listener: <<: *robotoff-base diff --git a/robotoff/insights/annotate.py b/robotoff/insights/annotate.py index b5fd789cf8..b599b2f028 100644 --- a/robotoff/insights/annotate.py +++ b/robotoff/insights/annotate.py @@ -717,7 +717,3 @@ def annotate( auth=auth, is_vote=is_vote, ) - - -class InvalidInsight(Exception): - pass diff --git a/robotoff/workers/tasks/import_image.py b/robotoff/workers/tasks/import_image.py index fcc43a6adb..b95f42453f 100644 --- a/robotoff/workers/tasks/import_image.py +++ b/robotoff/workers/tasks/import_image.py @@ -148,13 +148,15 @@ def run_import_image_job(product_id: ProductIdentifier, image_url: str, ocr_url: image_url=image_url, ocr_url=ocr_url, ) - enqueue_job( - run_nutrition_table_object_detection, - get_high_queue(product_id), - job_kwargs={"result_ttl": 0}, - product_id=product_id, - image_url=image_url, - ) + + if product_id.server_type.is_food(): + enqueue_job( + run_nutrition_table_object_detection, + get_high_queue(product_id), + job_kwargs={"result_ttl": 0}, + product_id=product_id, + image_url=image_url, + ) # Run UPC detection to detect if the image is dominated by a UPC (and thus # should not be a product selected image)