(injector: Injector) => (update: Partial<Pick<ScheduledTaskConfig<C>, 'schedule' | 'timezone' | 'timeout' | 'params'>>) => This method allows you to further configure existing scheduled tasks. For example, you may wish to change the schedule, timezone or timeout of a task, without having to define a new task.
Example
The arguments passed to the execute method of a scheduled task.
InjectorThe injector instance.
RequestContextA RequestContext instance that is configured for the scheduled task.
CThe parameters for the scheduled task.
The configuration for a scheduled task.
stringThe unique identifier for the scheduled task.
stringThe description for the scheduled task.
COptional parameters that will be passed to the execute function.
string | ((cronTime: typeof CronTime) => string)The cron schedule for the scheduled task. This can be a standard cron expression or a function that returns a cron-time-generator expression.
Example
stringv3.8.0undefinedThe IANA timezone identifier (e.g. 'Europe/Stockholm', 'America/New_York') in which
the cron schedule of this task is evaluated. Takes precedence over the global
schedulerOptions.timezone setting. When neither is set, the cron expression is
evaluated in the timezone of the Node.js process.
number | string60_000msThe timeout for the scheduled task. If the task takes longer than the timeout, the task will be considered to have failed with a timeout error.
booleantrueWhether the scheduled task should be prevented from running if it is already running.
(args: ScheduledTaskExecutionArgs<C>) => Promise<any>The function that will be executed when the scheduled task is run.
Architecture reviews, custom plugin work, migrations, ongoing support. Get a hand from the team that builds Vendure.
Talk to the team