Switch to using a CloseForLongOperation around the sleep

This commit is contained in:
Joseph Schorr 2015-01-29 14:50:07 -05:00
parent cf35da30bc
commit 7ee00b83cb
2 changed files with 18 additions and 27 deletions

View file

@ -1,6 +1,5 @@
from data.database import BUILD_PHASE, UseThenDisconnect
from data.database import BUILD_PHASE
from data import model
from app import app
class StatusHandler(object):
""" Context wrapper for writing status to build logs. """
@ -44,10 +43,9 @@ class StatusHandler(object):
self._append_log_message(phase, self._build_logs.PHASE, extra_data)
# Update the repository build with the new phase
with UseThenDisconnect(app.config):
repo_build = model.get_repository_build(self._uuid)
repo_build.phase = phase
repo_build.save()
repo_build = model.get_repository_build(self._uuid)
repo_build.phase = phase
repo_build.save()
return True