Task Runner for Deferred or Periodic Tasks #597

Merged
tobru merged 6 commits from feature/task-runner into main 2026-07-06 11:51:37 +00:00
Owner
No description provided.
Replaces K8s CronJobs as job scheduler and adds infrastructure for
future async work. Postgres-backed, so no new broker service.
clearsessions and send_expiration_reminders become periodic tasks
with exponential retry, preserving the old CronJobs' OnFailure
semantics. Tests swap in an InMemoryConnector via autouse fixture;
the SQLite dev fallback skips the Postgres-only migrations.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Single servala-worker Deployment runs periodic tasks and future
deferred jobs. First rollout: worker crash-loops until the web pod
has run migrate; delete the old CronJobs manually if apply does not
prune.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The periodic scheduler injects a timestamp kwarg but manual .defer()
passes no arguments, so a required timestamp parameter made every
manually deferred job fail with TypeError and burn through its
retries.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
fix(core): surface procrastinate logs on the console
All checks were successful
Tests / test (push) Successful in 1m31s
de2cde6751
Task failures were completely invisible: procrastinate logs through
Python logging, which had no console handler, so the worker appeared
to silently ignore jobs while they were actually failing and
retrying.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
feat(core): configurable task crons, timestamped worker logs
All checks were successful
Tests / test (push) Successful in 1m23s
24e1f768ed
Cron schedules move to settings with SERVALA_TASK_*_CRON env
overrides so schedule changes need no code change. Console log
format gains timestamp/level/logger, matching Django dev-server
output.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
tobru changed title from WIP: Task Runner for Deferred or Periodic Tasks to Task Runner for Deferred or Periodic Tasks 2026-07-06 11:50:40 +00:00
tobru merged commit 6d80513fa2 into main 2026-07-06 11:51:37 +00:00
tobru deleted branch feature/task-runner 2026-07-06 11:51:38 +00:00
Sign in to join this conversation.
No description provided.