Only perform the heartbeat check if the build is actually running. If it has completed, or has an error, then we know it is done.
This commit is contained in:
parent
81846f6a5f
commit
73ebcd45e3
1 changed files with 5 additions and 4 deletions
|
@ -70,6 +70,7 @@ def build_status_view(build_obj, can_write=False):
|
|||
|
||||
# If the status contains a heartbeat, then check to see if has been written in the last few
|
||||
# minutes. If not, then the build timed out.
|
||||
if phase != database.BUILD_PHASE.COMPLETE and phase != database.BUILD_PHASE.ERROR:
|
||||
if status is not None and 'heartbeat' in status and status['heartbeat']:
|
||||
heartbeat = datetime.datetime.fromtimestamp(status['heartbeat'])
|
||||
if datetime.datetime.now() - heartbeat > datetime.timedelta(minutes=1):
|
||||
|
|
Reference in a new issue