From 0f3d942b5e82d619bdc71fa14a58893b71bf1ec1 Mon Sep 17 00:00:00 2001 From: yackob03 Date: Wed, 13 Nov 2013 17:29:26 -0500 Subject: [PATCH] Re-add the missing method for getting repository builds. Add more logging to try to see why some builds are not getting removed from the queue. --- data/model.py | 8 ++++++++ workers/dockerfilebuild.py | 2 ++ 2 files changed, 10 insertions(+) diff --git a/data/model.py b/data/model.py index 87568d169..cfbb9340c 100644 --- a/data/model.py +++ b/data/model.py @@ -912,6 +912,14 @@ def load_token_data(code): raise InvalidTokenException('Invalid delegate token code: %s' % code) +def get_repository_build(request_dbid): + try: + return RepositoryBuild.get(RepositoryBuild.id == request_dbid) + except RepositoryBuild.DoesNotExist: + msg = 'Unable to locate a build by id: %s' % request_dbid + raise InvalidRepositoryBuildException(msg) + + def list_repository_builds(namespace_name, repository_name, include_inactive=True): joined = RepositoryBuild.select().join(Repository) diff --git a/workers/dockerfilebuild.py b/workers/dockerfilebuild.py index b78cb8b0c..a03342ea0 100644 --- a/workers/dockerfilebuild.py +++ b/workers/dockerfilebuild.py @@ -219,9 +219,11 @@ def process_work_items(pool): local_item = item def complete_callback(completed): if completed: + logger.debug('Queue item completed successfully, will be removed.') dockerfile_build_queue.complete(local_item) else: # We have a retryable error, add the job back to the queue + logger.debug('Queue item incomplete, will be retryed.') dockerfile_build_queue.incomplete(local_item) return complete_callback