Skip to main content

Module cron

Module cron 

Source
Expand description

Durable forge-cron persistence on the redb crons table.

The whole CronEntry record is stored as serde-json keyed by its CronId string - no field schema on disk, so a v1->v2 type change needs no table migration. Machine-local: crons are per-machine, not synced across the user’s Macs.

Re-exportsΒ§

use anyhow::Context; πŸ”’
use forge_primitives::cron::CronEntry; πŸ”’
use forge_primitives::cron::CronId; πŸ”’
use redb::ReadableTable; πŸ”’
use redb::TableDefinition; πŸ”’
use super::Db; πŸ”’

ConstantsΒ§

CRONS πŸ”’

FunctionsΒ§

delete
Delete a cron by id. Returns whether a record existed.
list
Every persisted cron.
upsert
Persist one cron, replacing any prior record with the same id. One write txn per row, so a write can only touch the row it names.