| Safe Haskell | None |
|---|---|
| Language | GHC2024 |
Arbiter.Core.CronSchedule
Contents
Description
Internal to the arbiter packages. Not covered by the PVP.
Types and DDL for the cron_schedules table.
Code-defined defaults and user overrides sit in separate columns. Worker pool startup upserts the defaults. An override survives every deploy.
Synopsis
- data CronScheduleRow = CronScheduleRow {
- name :: Text
- queueName :: Text
- defaultExpression :: Text
- defaultOverlap :: Text
- defaultTimezone :: Maybe Text
- overrideExpression :: Maybe Text
- overrideOverlap :: Maybe Text
- overrideTimezone :: Maybe Text
- enabled :: Bool
- lastFiredAt :: Maybe UTCTime
- lastCheckedAt :: Maybe UTCTime
- runRequestedAt :: Maybe UTCTime
- lastManualRunAt :: Maybe UTCTime
- createdAt :: UTCTime
- updatedAt :: UTCTime
- data CronScheduleUpdate = CronScheduleUpdate {
- overrideExpression :: Maybe (Maybe Text)
- overrideOverlap :: Maybe (Maybe Text)
- overrideTimezone :: Maybe (Maybe Text)
- enabled :: Maybe Bool
- effectiveExpression :: CronScheduleRow -> Text
- effectiveOverlap :: CronScheduleRow -> Text
- effectiveTimezone :: CronScheduleRow -> Maybe Text
- cronSchedulesTable :: SchemaName -> Text
- cronSchedulesTableName :: Text
- createCronSchedulesTableSQL :: SchemaName -> Text
- addTimezoneColumnSQL :: SchemaName -> Text
- addQueueNameColumnSQL :: SchemaName -> Text
- addRunRequestedColumnSQL :: SchemaName -> Text
- addLastManualRunColumnSQL :: SchemaName -> Text
Types
data CronScheduleRowSource #
A row from the cron_schedules table.
Constructors
| CronScheduleRow | |
Fields
| |
Instances
data CronScheduleUpdateSource #
A patch over a cron schedule's overrides. Nothing leaves a field unchanged,
Just Nothing clears the override back to the default, Just (Just v) sets it.
Constructors
| CronScheduleUpdate | |
Fields
| |
Instances
| FromJSON CronScheduleUpdate Source # | |||||
Defined in Arbiter.Core.CronSchedule Methods parseJSON :: Value -> Parser CronScheduleUpdate# parseJSONList :: Value -> Parser [CronScheduleUpdate]# | |||||
| ToJSON CronScheduleUpdate Source # | |||||
Defined in Arbiter.Core.CronSchedule Methods toJSON :: CronScheduleUpdate -> Value# toEncoding :: CronScheduleUpdate -> Encoding# toJSONList :: [CronScheduleUpdate] -> Value# toEncodingList :: [CronScheduleUpdate] -> Encoding# omitField :: CronScheduleUpdate -> Bool# | |||||
| Eq CronScheduleUpdate Source # | |||||
Defined in Arbiter.Core.CronSchedule Methods (==) :: CronScheduleUpdate -> CronScheduleUpdate -> Bool# (/=) :: CronScheduleUpdate -> CronScheduleUpdate -> Bool# | |||||
| Generic CronScheduleUpdate Source # | |||||
Defined in Arbiter.Core.CronSchedule Associated Types
Methods from :: CronScheduleUpdate -> Rep CronScheduleUpdate x# to :: Rep CronScheduleUpdate x -> CronScheduleUpdate# | |||||
| Show CronScheduleUpdate Source # | |||||
Defined in Arbiter.Core.CronSchedule Methods showsPrec :: Int -> CronScheduleUpdate -> ShowS# show :: CronScheduleUpdate -> String# showList :: [CronScheduleUpdate] -> ShowS# | |||||
| type Rep CronScheduleUpdate Source # | |||||
Defined in Arbiter.Core.CronSchedule type Rep CronScheduleUpdate = D1 ('MetaData "CronScheduleUpdate" "Arbiter.Core.CronSchedule" "arbiter-core-0.1.0.0-inplace" 'False) (C1 ('MetaCons "CronScheduleUpdate" 'PrefixI 'True) ((S1 ('MetaSel ('Just "overrideExpression") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe (Maybe Text))) :*: S1 ('MetaSel ('Just "overrideOverlap") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe (Maybe Text)))) :*: (S1 ('MetaSel ('Just "overrideTimezone") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe (Maybe Text))) :*: S1 ('MetaSel ('Just "enabled") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Bool))))) | |||||
Effective values
effectiveExpression :: CronScheduleRow -> TextSource #
The override expression if set, else the default.
effectiveOverlap :: CronScheduleRow -> TextSource #
The override overlap policy if set, else the default.
effectiveTimezone :: CronScheduleRow -> Maybe TextSource #
The override timezone if set, else the default. Nothing means UTC.
DDL
cronSchedulesTable :: SchemaName -> TextSource #
Qualified table name for the cron_schedules table.
cronSchedulesTableName :: TextSource #
Bare name of the cron table, for catalog lookups by relname.
createCronSchedulesTableSQL :: SchemaName -> TextSource #
DDL for the cron_schedules table. Later migrations add columns.
addTimezoneColumnSQL :: SchemaName -> TextSource #
Idempotent migration adding the timezone columns to an existing table.
addQueueNameColumnSQL :: SchemaName -> TextSource #
Idempotent migration adding the queue name column to an existing table.
addRunRequestedColumnSQL :: SchemaName -> TextSource #
Idempotent migration adding the manual run-request column to an existing table.
addLastManualRunColumnSQL :: SchemaName -> TextSource #
Idempotent migration adding the manual last-run column to an existing table.