Table of Contents

Struct ScheduleJobOptions

Namespace
Quartz
Assembly
Quartz.dll

How jobs and their triggers are stored when they are scheduled together.

public readonly record struct ScheduleJobOptions : IEquatable<ScheduleJobOptions>
Implements
Inherited Members

Remarks

Defaults are the conservative ones: nothing is replaced, nothing is paused. So default — which is what omitting the argument gives — is "store them, replace nothing", and there is no third state between "not given" and "all defaults".

This is deliberately not AddJobOptions. That one also carries StoreNonDurableWhileAwaitingScheduling, which has no meaning here: a trigger is always supplied, so the job is never awaiting scheduling. Its Replace is about the job alone, where this one covers the job and its triggers together.

Properties

PauseReason

Why the triggers are stored paused, recorded on each as Reason. Setting it stores them paused. Blank reads as unset; longer than MaxReasonLength is cut.

public string? PauseReason { get; init; }

Property Value

string

PauseRequestedBy

Who asked for the triggers to be stored paused, recorded on each as RequestedBy. Setting it stores them paused. Blank reads as unset; longer than MaxRequestedByLength is cut.

public string? PauseRequestedBy { get; init; }

Property Value

string

Paused

Whether the triggers are stored paused, so none of them fires until it is resumed. Reads true when PauseReason or PauseRequestedBy is set.

public bool Paused { get; init; }

Property Value

bool

Remarks

The store writes each trigger paused in the operation that stores it, so no trigger is acquirable in between, as it is between a ScheduleJob and a PauseTrigger. A trigger whose job disallows concurrent execution and is running is stored paused-blocked. Over a paused group, and over a trigger it replaces, the pause and the record are this one.

A store that does not say SupportsStoringPaused stores the triggers as usual, and the scheduler pauses them straight afterwards: a trigger due at once can fire in between. Every store Quartz ships says it.

A continuation waits for its parent rather than for a resume, so the scheduler refuses one stored paused.

Replace

Whether already stored jobs and triggers with the same keys are over-written. When false, scheduling a job or trigger whose key already exists throws ObjectAlreadyExistsException.

public bool Replace { get; init; }

Property Value

bool

Replacing

Over-write already stored jobs and triggers with the same keys. The name for new ScheduleJobOptions { Replace = true }, which is what nearly every call that passes these options at all is saying.

public static ScheduleJobOptions Replacing { get; }

Property Value

ScheduleJobOptions

See Also