Skip to content

PR build status: re-try up to 3 times if it fails for some reason #8296

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 29, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions readthedocs/builds/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,11 @@ def sync_versions_task(project_pk, tags_data, branches_data, **kwargs):
return True


@app.task(queue='web')
@app.task(
max_retries=3,
default_retry_delay=60,
queue='web'
)
def send_build_status(build_pk, commit, status, link_to_build=False):
"""
Send Build Status to Git Status API for project external versions.
Expand All @@ -367,7 +371,7 @@ def send_build_status(build_pk, commit, status, link_to_build=False):

provider_name = build.project.git_provider_name

log.info('Sending build status. build=%s, project=%s', build.pk, build.project.slug)
log.info('Sending build status. build=%s project=%s', build.pk, build.project.slug)

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

log.info(
'No social account or repository permission available for %s',
'No social account or repository permission available. project=%s',
build.project.slug
)
return False