Skip to content

Type Alias: ScheduleEntrypointOptions ​

ScheduleEntrypointOptions = object

The options of scheduleEntrypoint.

Properties ​

middlewares? ​

optional middlewares?: MiddlewareDefinition[]

The middlewares of this adapter's runs, run after the entrypoint's global middlewares.


name? ​

optional name?: string

The adapter name, to tell apart several schedule adapters of one entrypoint.


onError? ​

optional onError?: (error, action, context) => void | Promise<void>

Called when a run fails (the action, a middleware or the access control threw), with the error, the action and the run's context. A failed run does not stop the next ones.

Parameters ​

error ​

unknown

action ​

ChannelActionInfo

context ​

ScheduleContext

Returns ​

void | Promise<void>

Default ​

the error is written to the application's log component (console.error without one)


onSkip? ​

optional onSkip?: (action, scheduledAt, reason) => void

Called when a run is skipped, with the action, the time the run was due and why: 'overlap' when the action's previous run is still in progress (an action without overlap: true), 'exclusive' when another instance of the application holds the run's lock (an exclusive action). An error it throws is written to the application's log component; the schedule goes on.

Parameters ​

action ​

ChannelActionInfo

scheduledAt ​

Date

reason ​

"overlap" | "exclusive"

Returns ​

void

Released under the MIT License.