WIP: Feat: Add celery beat for scheduling new cronjobs - #2813
Draft
susilnem wants to merge 1 commit into
Draft
Conversation
- Introduce django-celery-beat
- main/cronjobs.py: SCHEDULES registry, kombu queues (default/heavy/cronjob)
feeding task_queues, per-job Sentry monitor config, and a beat_init hook
that prunes PeriodicTask rows for removed jobs ("manual:" rows spared)
- seed jobs: clear_expired_django_sessions (django_session was never pruned)
and a per-queue celery_queue_uptime_check heartbeat
- main/sentry.py: SentryConfig dataclass, every option passed to
sentry_sdk.init() by name so an unrecognised key cannot reach it
- SENTRY_DEBUG decouples Sentry verbosity from DJANGO_DEBUG
- misc/dev: worker and beat entrypoints with a broker wait
- tests in main/test_cronjobs.py, a django check for SCHEDULES task paths,
and docs/cronjobs.md
thenav56
approved these changes
Aug 17, 2026
| logger.info(f"End export: {export.pk}") | ||
|
|
||
|
|
||
| # TODO(susilnem): Do we need this cron? |
Member
There was a problem hiding this comment.
Member
Author
There was a problem hiding this comment.
But it would be effective only for the admin panel users. right?
| command: python manage.py run_celery_dev | ||
| restart: unless-stopped | ||
| command: ./misc/dev/run_worker.sh | ||
| healthcheck: |
Member
There was a problem hiding this comment.
Let's add TODO here for healthcheck to upate after banjo-utils integration
| celery-beat: | ||
| <<: *base_server_setup | ||
| restart: unless-stopped | ||
| command: ./misc/dev/run_worker_beat.sh |
Member
There was a problem hiding this comment.
Let's add TODO here for healthcheck to upate after banjo-utils integration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Introduce django-celery-beat so new cronjobs can be declared in code and
dispatched by a beat process, instead of adding another Kubernetes CronJob.
Existing cronjobs are untouched. The 30 legacy jobs keep running as k8s
CronJobs from values.yaml:cronjobs and stay monitored via SentryMonitor +
manage.py cron_job_monitor. A job belongs to one mechanism or the other,never both -- SentryMonitor.validate_config() asserts the enum matches
values.yaml.
Changes
Checklist
Things that should succeed before merging.
Release
If there is a version update, make sure to tag the repository with the latest version.