diff --git a/data/queue.py b/data/queue.py index 3038b8389..8e63c4d17 100644 --- a/data/queue.py +++ b/data/queue.py @@ -54,6 +54,10 @@ class WorkQueue(object): def complete(self, completed_item): completed_item.delete_instance() + def incomplete(self, incomplete_item): + incomplete_item.available = True + incomplete_item.save() + image_diff_queue = WorkQueue('imagediff') dockerfile_build_queue = WorkQueue('dockerfilebuild') diff --git a/workers/dockerfilebuild.py b/workers/dockerfilebuild.py index dc4209d35..2f7aea2da 100644 --- a/workers/dockerfilebuild.py +++ b/workers/dockerfilebuild.py @@ -212,6 +212,10 @@ def process_work_items(pool): def complete_callback(completed): if completed: dockerfile_build_queue.complete(local_item) + else: + # We have a retryable error, add the job back to the queue + dockerfile_build_queue.incomplete(local_item) + return complete_callback logger.debug('Sending work item to thread pool: %s' % pool)