| Safe Haskell | None |
|---|---|
| Language | GHC2024 |
Arbiter.Core.Sql.Cron
Description
Cron SQL templates.
Synopsis
- allCronColumns :: Text
- upsertCronDefaultSQL :: Text -> Text -> Text -> Text -> Text -> Maybe Text -> Query ()
- listCronSchedulesSQL :: Text -> Maybe Text -> Query CronScheduleRow
- getCronScheduleByNameSQL :: Text -> Text -> Query CronScheduleRow
- updateCronScheduleSQL :: Text -> Text -> CronScheduleUpdate -> Maybe (Query ())
- touchCronLastFiredSQL :: Text -> Text -> Query ()
- touchCronCheckedSQL :: Text -> UTCTime -> [Text] -> Query ()
- tryFireCronGateSQL :: Text -> UTCTime -> Text -> Query ()
- tryAcquireCronLeaderSQL :: Text -> Text -> Text -> Query Bool
- requestCronRunSQL :: Text -> Text -> Query Text
- claimCronRunSQL :: Text -> Text -> Query CronScheduleRow
- touchCronManualRunSQL :: Text -> UTCTime -> Text -> Query ()
- pendingCronRunsSQL :: Text -> [Text] -> Query Text
Documentation
Source #allCronColumns :: Text
The cron_schedules read columns, in codec order.
Source #upsertCronDefaultSQL :: Text -> Text -> Text -> Text -> Text -> Maybe Text -> Query ()
Upsert a cron schedule's default values, preserving override_* columns on conflict.
An unchanged schedule is left alone.
Source #listCronSchedulesSQL :: Text -> Maybe Text -> Query CronScheduleRow
List cron schedules ordered by name, optionally filtered by queue.
Source #getCronScheduleByNameSQL :: Text -> Text -> Query CronScheduleRow
Get a single cron schedule by name.
Source #updateCronScheduleSQL :: Text -> Text -> CronScheduleUpdate -> Maybe (Query ())
Patch a cron schedule's overrides. Nothing when the patch sets no column.
Just Nothing clears an override. Disabling also drops a pending run request.
Source #touchCronCheckedSQL :: Text -> UTCTime -> [Text] -> Query ()
Set last_checked_at to the caller-supplied watermark for the given
schedule names. The watermark is the minute boundary the scheduler finished
evaluating. GREATEST keeps it from moving backward under concurrent worker
pools with skewed clocks.
Source #tryFireCronGateSQL :: Text -> UTCTime -> Text -> Query ()
Fire-once-per-minute gate. Advances last_fired_at to the minute floor
when the existing value is less. Zero rows means another pool won.
Source #tryAcquireCronLeaderSQL :: Text -> Text -> Text -> Query Bool
Per-(schema, queue, name) transaction-scoped advisory lock for cron.
Source #requestCronRunSQL :: Text -> Text -> Query Text
Stamp a run request on an enabled schedule and NOTIFY, returning a status.
Source #claimCronRunSQL :: Text -> Text -> Query CronScheduleRow
Claim a pending run request, clearing the flag and returning the claimed row.