Skip to content

Commit 36c9a27

Browse files
committed
Merge branch 'master' of github.com:rtfd/readthedocs.org
* 'master' of github.com:rtfd/readthedocs.org: Fix shitpost Fix copypasta issue with supervisord config Update Build state at the end of UpdateDocsTask.run (readthedocs#3293)
2 parents 614f018 + f93e509 commit 36c9a27

File tree

2 files changed

+13
-20
lines changed

2 files changed

+13
-20
lines changed

contrib/supervisord.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ stderr_logfile = /dev/stderr
3434
stderr_logfile_maxbytes = 0
3535

3636
[program:celery]
37-
command = celery worker -A readthedocsinc -Q default,celery,web,builder -l DEBUG -c 2
37+
command = celery worker -A readthedocs -Q default,celery,web,builder -l DEBUG -c 2
3838
directory = ../
3939
priority = 100
4040
stopasgroup = True

readthedocs/projects/tasks.py

+12-19
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ def run(self, pk, version_pk=None, build_pk=None, record=True,
116116
117117
This is fully wrapped in exception handling to account for a number of failure cases.
118118
"""
119+
unhandled_failure = ''
119120
try:
120121
self.project = self.get_project(pk)
121122
self.version = self.get_version(self.project, version_pk)
@@ -128,30 +129,22 @@ def run(self, pk, version_pk=None, build_pk=None, record=True,
128129
setup_successful = self.run_setup(record=record)
129130
if setup_successful:
130131
self.run_build(record=record, docker=docker)
131-
failure = self.setup_env.failure or self.build_env.failure
132132
except Exception as e: # noqa
133133
log.exception(
134134
'An unhandled exception was raised outside the build environment',
135135
extra={'tags': {'build': build_pk}}
136136
)
137-
failure = _('Unknown error encountered. '
138-
'Please include the build id ({build_id}) in any bug reports.'.format(
139-
build_id=build_pk
140-
))
141-
142-
# **Always** report build status.
143-
# This can still fail if the API Is totally down, but should catch more failures
144-
result = {}
145-
build_updates = {'state': BUILD_STATE_FINISHED}
146-
build_data = {}
147-
if hasattr(self, 'build'):
148-
build_data.update(self.build)
149-
if failure:
150-
build_updates['success'] = False
151-
build_updates['error'] = failure
152-
build_data.update(build_updates)
153-
result = api_v2.build(build_pk).patch(build_updates)
154-
return result
137+
unhandled_failure = _(
138+
'Unknown error encountered. '
139+
'Please include the build id ({build_id}) in any bug reports.'.format(
140+
build_id=build_pk
141+
))
142+
finally:
143+
if unhandled_failure:
144+
self.build_env.build['error'] = unhandled_failure
145+
self.build_env.update_build(BUILD_STATE_FINISHED)
146+
147+
return self.build_env.build
155148

156149
def run_setup(self, record=True):
157150
"""Run setup in the local environment.

0 commit comments

Comments
 (0)