Skip to main content

TaskScheduleDefinition.initialDelay

Home > @backstage/backend-tasks > TaskScheduleDefinition > initialDelay

The amount of time that should pass before the first invocation happens.

Signature:

initialDelay?: Duration | HumanDuration;

Remarks

This can be useful in cold start scenarios to stagger or delay some heavy compute jobs. If no value is given for this field then the first invocation will happen as soon as possible according to the cadence.

NOTE: This is a per-worker delay. If you have a cluster of workers all collaborating on a task that has its scope field set to 'global', then you may still see the task being processed by other long-lived workers, while any given single worker is in its initial sleep delay time e.g. after a deployment. Therefore, this parameter is not useful for "globally" pausing work; its main intended use is for individual machines to get a chance to reach some equilibrium at startup before triggering heavy batch workloads.