Skip to content

Commit

Permalink
Fix beat task
Browse files Browse the repository at this point in the history
  • Loading branch information
vrigal committed Nov 10, 2023
1 parent c99dfc3 commit 3a3ceb9
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions treeherder/config/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

from treeherder.config.utils import connection_should_use_tls
from treeherder.middleware import add_headers_function
from celery.schedules import crontab

# TODO: Switch to pathlib once using Python 3.
SRC_DIR = dirname(dirname(dirname(abspath(__file__))))
Expand Down Expand Up @@ -379,8 +380,11 @@
CELERY_TASK_SOFT_TIME_LIMIT = 15 * 60
CELERY_TASK_TIME_LIMIT = CELERY_TASK_SOFT_TIME_LIMIT + 30

# Periodically publish runtime statistics on statsd
CELERY_STATS_PUBLICATION_DELAY = 15 * 60
# Periodically publish runtime statistics on statsd (in minutes)
CELERY_STATS_PUBLICATION_DELAY = 5
assert (
0 < CELERY_STATS_PUBLICATION_DELAY < 60 and 60 % 10 == 0
), "Celery task must be a valid cron delay in minutes"

CELERY_BEAT_SCHEDULE = {
# this is just a failsafe in case the Pulse ingestion misses something
Expand All @@ -391,8 +395,9 @@
'options': {"queue": "pushlog"},
},
'publish_stats': {
'task': 'publis-stats',
'schedule': CELERY_STATS_PUBLICATION_DELAY,
'task': 'publish-stats',
'schedule': crontab(minute=f'*/{CELERY_STATS_PUBLICATION_DELAY}'),
'relative': True,
'options': {'queue': 'statsd'},
},
}
Expand Down

0 comments on commit 3a3ceb9

Please sign in to comment.