generated from TBD54566975/tbd-project-template
-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Convert cron jobs to async calls #2197
Labels
techdebt
Issue is technical debt
Comments
Open
github-merge-queue bot
pushed a commit
that referenced
this issue
Aug 23, 2024
This refactor removes the cron job system's state management, cron execution, and hashring management, in favor of the async call system. Data tables changed as follows: - `cron_jobs` is still used to maintain the job list - Removes `state`, adds `last_execution::timestampz` and `last_async_call_id::bigint` - `async_calls` is inserted to by the cron system - `cron_jobs.last_async_call_id = async_calls.id` - Adds the notion of a `cron` origin in `async_calls.origin` After a deployment, all valid unscheduled cron jobs are scheduled; a row is added to `async_calls` with a `pending` state and `scheduled_at` is set to the job's next execution time. The corresponding row in `cron_jobs` is also updated with the scheduled async call, the computed next execution time, and the inserted async call ID. On completion of a cron async call, the next execution of that job is scheduled. Effectively, every cron job will have exactly one scheduled execution. Closes #2197 --------- Co-authored-by: Alec Thomas <[email protected]>
This was referenced Aug 27, 2024
Open
Open
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently cron jobs have their own bespoke execution system. To take advantage of retries, catch, etc. we should convert these to use async.
The text was updated successfully, but these errors were encountered: