Skip to content

Commit 66c8a35

Browse files
committed
PR build status: re-try up to 3 times if it fails for some reason
Sometimes it happens that the task fail for some reason and people don't get the PR status updated for RTD build. This commit adds a retry up to 3 times to avoid these cases. Closes #8177
1 parent 43102ae commit 66c8a35

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

readthedocs/builds/tasks.py

+7-3
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,11 @@ def sync_versions_task(project_pk, tags_data, branches_data, **kwargs):
346346
return True
347347

348348

349-
@app.task(queue='web')
349+
@app.task(
350+
max_retries=3,
351+
default_retry_delay=60,
352+
queue='web'
353+
)
350354
def send_build_status(build_pk, commit, status, link_to_build=False):
351355
"""
352356
Send Build Status to Git Status API for project external versions.
@@ -367,7 +371,7 @@ def send_build_status(build_pk, commit, status, link_to_build=False):
367371

368372
provider_name = build.project.git_provider_name
369373

370-
log.info('Sending build status. build=%s, project=%s', build.pk, build.project.slug)
374+
log.info('Sending build status. build=%s project=%s', build.pk, build.project.slug)
371375

372376
if provider_name in [GITHUB_BRAND, GITLAB_BRAND]:
373377
# get the service class for the project e.g: GitHubService.
@@ -445,7 +449,7 @@ def send_build_status(build_pk, commit, status, link_to_build=False):
445449
notification.send()
446450

447451
log.info(
448-
'No social account or repository permission available for %s',
452+
'No social account or repository permission available. project=%s',
449453
build.project.slug
450454
)
451455
return False

0 commit comments

Comments
 (0)