Skip to content

Commit

Permalink
Avoid infinite loop waiting for Tool deployment (#776)
Browse files Browse the repository at this point in the history
Break out of the wait loop if the deployment status is anything other than
TOOL_DEPLOYING - this may result in some deployments being reported as failed
incorrectly, but should avoid the consumer getting stuck.
  • Loading branch information
andyhd authored Nov 13, 2019
1 parent e40f9a9 commit fc30fe3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions controlpanel/frontend/consumers.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,10 +200,10 @@ def start_background_task(task, message):
)

def wait_for_deployment(deployment, id_token):
while True:
status = TOOL_DEPLOYING
while status == TOOL_DEPLOYING:
status = deployment.get_status(id_token)
update_tool_status(deployment.user, deployment.tool, status)
if status in (TOOL_DEPLOY_FAILED, TOOL_READY, TOOL_IDLED):
return status
sleep(1)
return status

0 comments on commit fc30fe3

Please sign in to comment.