Fix display for builds which have fully expired

Fixes #1663
This commit is contained in:
Joseph Schorr 2016-08-03 18:08:04 -04:00
parent 432bdc7e3e
commit b7bde27b3c
12 changed files with 164 additions and 149 deletions

View file

@ -112,13 +112,13 @@ def _get_build_status(build_obj):
if datetime.datetime.utcnow() - heartbeat > datetime.timedelta(minutes=1):
phase = database.BUILD_PHASE.INTERNAL_ERROR
# If the phase is internal error, return 'error' instead if the number of retries
# on the queue item is 0.
if phase == database.BUILD_PHASE.INTERNAL_ERROR:
retry = (build_obj.queue_id and
dockerfile_build_queue.has_retries_remaining(build_obj.queue_id))
if not retry:
phase = database.BUILD_PHASE.ERROR
# If the phase is internal error, return 'expired' instead if the number of retries
# on the queue item is 0.
if phase == database.BUILD_PHASE.INTERNAL_ERROR:
retry = (build_obj.queue_id and
dockerfile_build_queue.has_retries_remaining(build_obj.queue_id))
if not retry:
phase = 'expired'
return (phase, status, error)