pub struct JobScheduleUpsert<'a> {
pub name: &'a str,
pub job_type: JobType<'a>,
pub organization_id: Option<Uuid>,
pub payload_template: &'a Value,
pub cron_expr: &'a str,
pub is_active: bool,
pub next_fire_at: DateTime<Utc>,
pub max_jitter_seconds: i32,
}Expand description
Input for creating or updating a cron-backed job schedule.
Schedules are keyed by name. Updating an existing schedule refreshes the
stored job type, payload template, cron expression, and jitter, while leaving
scheduler-managed state intact. organization_id and is_active apply only
when a new schedule row is inserted. next_fire_at applies on insert and
when the cron expression changes.
Cron expressions are interpreted in UTC and must be accepted by
cron::Schedule::from_str, the same parser used by runledger-runtime when
materializing due schedules. The upsert validator rejects blank or padded
schedule names, blank or padded cron expressions, invalid cron expressions,
negative jitter, and jitter above 86,400 seconds.
This input does not encode a compile-time job catalog. The PostgreSQL schema
requires a matching job-definition row for job_type, but this API does not
prove that a worker process has registered a runtime handler for that job
type.
Fields§
§name: &'a strStable unique schedule name without surrounding whitespace.
job_type: JobType<'a>Job type to enqueue whenever the schedule fires.
organization_id: Option<Uuid>Optional organization scope for enqueued jobs on first insert.
payload_template: &'a ValueJSON payload copied into each job created by the scheduler.
cron_expr: &'a strUTC cron expression without surrounding whitespace, validated on upsert and parsed again when the schedule fires.
is_active: boolWhether the runtime scheduler should claim this schedule on first insert.
next_fire_at: DateTime<Utc>Initial fire cursor for the scheduler, also used when changing cron syntax.
max_jitter_seconds: i32Maximum deterministic jitter applied when materializing a due schedule, capped at 86,400 seconds.
Trait Implementations§
Source§impl<'a> Clone for JobScheduleUpsert<'a>
impl<'a> Clone for JobScheduleUpsert<'a>
Source§fn clone(&self) -> JobScheduleUpsert<'a>
fn clone(&self) -> JobScheduleUpsert<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl<'a> Freeze for JobScheduleUpsert<'a>
impl<'a> RefUnwindSafe for JobScheduleUpsert<'a>
impl<'a> Send for JobScheduleUpsert<'a>
impl<'a> Sync for JobScheduleUpsert<'a>
impl<'a> Unpin for JobScheduleUpsert<'a>
impl<'a> UnsafeUnpin for JobScheduleUpsert<'a>
impl<'a> UnwindSafe for JobScheduleUpsert<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more