Skip to content

Commit 9eb0868

Browse files
authored
Tasks: increase time limit sync_remote_repositories_from_sso_organizations (#12488)
This task takes 2h 10m to complete right now. I didn't see anything in sentry about this task failing (not sure even if that will be reported there). Looks like the default time out is one hour: https://github.com/readthedocs/readthedocs.org/blob/dcde018f1567a028cb17a2cad4990f489c0d8f8e/readthedocs/settings/base.py#L630 This would be a great use case for async python... Maybe something to explore https://stackoverflow.com/questions/72529998/how-to-use-async-function-inside-celery-task
1 parent 94d0e6c commit 9eb0868

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

readthedocs/oauth/tasks.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,12 @@ def sync_remote_repositories(user_id, skip_githubapp=False):
7373
)
7474

7575

76-
@app.task(queue="web")
76+
@app.task(
77+
queue="web",
78+
# This is a long running task, since it syncs all repositories one by one.
79+
time_limit=60 * 60 * 3, # 3h
80+
soft_time_limit=(60 * 60 * 3) - 5 * 60, # 2h 55m
81+
)
7782
def sync_remote_repositories_from_sso_organizations():
7883
"""
7984
Re-sync all remote repositories from organizations with SSO enabled.

0 commit comments

Comments
 (0)