Table of Contents

Struct AddJobOptions

Namespace
Quartz
Assembly
Quartz.dll

How a job is added to the scheduler when it is stored without a trigger.

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

Remarks

Defaults are the conservative ones: nothing is replaced, and a non-durable job is rejected. So default — which is what omitting the argument gives — is "add it, change nothing else", and there is no third state between "not given" and "all defaults" for an implementer to have to guess about.

Properties

Replace

Whether an already stored job with the same key is over-written. When false, storing a job whose key already exists throws ObjectAlreadyExistsException.

public bool Replace { get; init; }

Property Value

bool

Replacing

Over-write an already stored job with the same key. The name for new AddJobOptions { Replace = true }, which is what nearly every call that passes these options at all is saying.

public static AddJobOptions Replacing { get; }

Property Value

AddJobOptions

ReplacingAndStoringNonDurable

Store a job that is not durable while it waits for the trigger that will schedule it, and over-write one already stored under the same key. The name for new AddJobOptions { Replace = true, StoreNonDurableWhileAwaitingScheduling = true }.

public static AddJobOptions ReplacingAndStoringNonDurable { get; }

Property Value

AddJobOptions

Remarks

The pair is what "put this job in place, I will schedule it in a moment" needs, and the two flags are only useful together: storing a non-durable job that must not be replaced fails the second time the same start-up path runs, which is the one thing this shape exists to survive.

StoreNonDurableWhileAwaitingScheduling

Whether a job that is not durable may be stored while it is still awaiting a trigger. Once such a job is scheduled it resumes normal non-durable behaviour, i.e. it is deleted as soon as it has no remaining triggers.

public bool StoreNonDurableWhileAwaitingScheduling { get; init; }

Property Value

bool

Remarks

This is a scheduler-level concern only: AddJob(IJobDetail, AddJobOptions, CancellationToken) stores whatever it is given, and the durability rule is enforced by IScheduler above it.

See Also