Skip to content

Commit 2555fe0

Browse files
committed
Setup task to be ran by celery beat
1 parent e035eac commit 2555fe0

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

readthedocs/settings/base.py

+11
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88

99
from readthedocs.core.settings import Settings
1010

11+
from celery.schedules import crontab
12+
13+
1114
try:
1215
import readthedocsext # noqa
1316
ext = True
@@ -240,6 +243,14 @@ def USE_PROMOS(self): # noqa
240243
CELERY_CREATE_MISSING_QUEUES = True
241244

242245
CELERY_DEFAULT_QUEUE = 'celery'
246+
CELERYBEAT_SCHEDULE = {
247+
# Ran every hour on minute 30
248+
'hourly-remove-orphan-symlinks': {
249+
'task': 'readthedocs.projects.tasks.remove_orphan_symlinks',
250+
'schedule': crontab(minute=30),
251+
'options': {'queue': 'web'},
252+
},
253+
}
243254

244255
# Docker
245256
DOCKER_ENABLE = False

0 commit comments

Comments
 (0)