Skip to content

Commit 3e1651e

Browse files
humitosagjohnson
authored andcommitted
Update build from database at __exit__ (readthedocs#3292)
* Update build from database at __exit__ When an exception happens and it's handled by __exit__ our Build in the database is not updated and it stay in 'Installing' forever. So, when something bad happens we force a call to `update_build` with the FINISHED state Attempt to fix readthedocs#3285 * `update_build` when FINISHED in the right place
1 parent d6eac0e commit 3e1651e

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,4 @@ private_*
4444
readthedocs/htmlcov
4545
tags
4646
.python-version
47+
*.pyo

readthedocs/projects/tasks.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ def run_setup(self, record=True):
196196
if not isinstance(self.setup_env.failure, vcs_support_utils.LockTimeout):
197197
self.send_notifications()
198198

199+
self.setup_env.update_build(state=BUILD_STATE_FINISHED)
199200
return False
200201

201202
if self.setup_env.successful and not self.project.has_valid_clone:
@@ -257,6 +258,8 @@ def run_build(self, docker=False, record=True):
257258

258259
if self.build_env.failed:
259260
self.send_notifications()
261+
262+
self.build_env.update_build(state=BUILD_STATE_FINISHED)
260263
build_complete.send(sender=Build, build=self.build_env.build)
261264

262265
@staticmethod

0 commit comments

Comments
 (0)