-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Define useful celery beat task for development #3762
Changes from all commits
9cb4ef6
e035eac
2555fe0
b68ea63
7f062f9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,9 @@ | |
|
||
from readthedocs.core.settings import Settings | ||
|
||
from celery.schedules import crontab | ||
|
||
|
||
try: | ||
import readthedocsext # noqa | ||
ext = True | ||
|
@@ -241,6 +244,19 @@ def USE_PROMOS(self): # noqa | |
CELERY_CREATE_MISSING_QUEUES = True | ||
|
||
CELERY_DEFAULT_QUEUE = 'celery' | ||
CELERYBEAT_SCHEDULE = { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We need to make sure we aren't overridding this elsewhere. We need a good pattern here, but I'm guessing we aren't extending this everywhere else we use it, so this might get killed by a downstream config file overwriting it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I found we use this setting in 3 places:
@ericholscher please confirm this, and I will open a PR for corporate ops to modify this file https://github.com/readthedocs/readthedocs-corporate-ops/blob/master/salt/corporate/readthedocsinc/settings/base.py There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You need a property override there as well, correct. |
||
# Ran every hour on minute 30 | ||
'hourly-remove-orphan-symlinks': { | ||
'task': 'readthedocs.projects.tasks.remove_orphan_symlinks', | ||
'schedule': crontab(minute=30), | ||
'options': {'queue': 'web'}, | ||
}, | ||
'quarter-finish-inactive-builds': { | ||
'task': 'readthedocs.projects.tasks.finish_inactive_builds', | ||
'schedule': crontab(minute='*/15'), | ||
'options': {'queue': 'web'}, | ||
}, | ||
} | ||
|
||
# Docker | ||
DOCKER_ENABLE = False | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if these should go in another file.
projects/tasks
is already huge, so it might make sense to move this intocore/tasks.py
or somewhere else specifically for scheduled tasks?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. I agree with this.
I created this issue (#3775) to refactor this and include some other tasks also --we can discuss in the issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually dislike putting things in
core
. Why not split up into:readthedocs.projects.tasks.build
readthedocs.projects.tasks.sync
Some of the tasks might make more sense in
builds/
as well. I findcore/
is not a helpful concept, save for only the most generalized of code.