Skip to content

Commit

Permalink
moved the celerybeat scheduler to settings file;
Browse files Browse the repository at this point in the history
  • Loading branch information
ranjan-stha authored and k9845 committed Aug 9, 2023
1 parent f836fc8 commit 492548a
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 38 deletions.
36 changes: 36 additions & 0 deletions core_server/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"""

from pathlib import Path
from celery.schedules import crontab

import sentry_sdk
from sentry_sdk.integrations.django import DjangoIntegration
Expand Down Expand Up @@ -200,3 +201,38 @@
# django.contrib.auth) you may enable sending PII data.
send_default_pii=True
)

CELERY_BEAT_SCHEDULE = {
"fetch_deep_data": {
"task": "core.tasks.get_data.fetch_deep_data",
"schedule": crontab(
minute=env("CRON_DEEP_FETCH_MINUTE"),
hour=env("CRON_DEEP_FETCH_HOUR"),
), # defaults to every day at 12:00 AM
},
"calculate_model_metrics": {
"task": "core.tasks.model_monitoring.calculate_model_metrics",
"schedule": crontab(
minute="*/1",
),
},
"fetch_new_projects": {
"task": "core.tasks.get_data.fetch_new_projects",
"schedule": crontab(
hour="*/12", # Do it every 12 hours
minute="0",
),
},
"retry_failed_callbacks": {
"task": "core.tasks.resend_failed_callbacks",
"schedule": crontab(
minute=env("CRON_FAILED_CALLBACK_SCHEDULE"),
),
},
"process_pending_nlp_requests": {
"task": "analysis_module.tasks.process_pending_nlp_requests",
"schedule": crontab(
minute=env("CRON_RESEND_ECS_REQUEST_MINUTES"),
),
},
}
38 changes: 0 additions & 38 deletions core_server/tasks_settings.py

This file was deleted.

0 comments on commit 492548a

Please sign in to comment.