Skip to content

@saflib/cron-http


@saflib/cron-http

Interfaces

InterfaceDescription
CronEnqueueParamsParams for one cron-tick enqueue. Mirrored by @saflib/jobs-http makeCronEnqueuer so @saflib/cron-http does not import @saflib/jobs-http.
CronEnqueueResult-
CronJobRequestStatic request payload for the operation a cron tick enqueues. Dynamic fan-out belongs in the target handler.
CronServiceOptionsOptions to be passed when starting a cron service.
CustomLogErrorMetaData passed to the error callback.
JobConfigConfiguration for a single cron job. Cron ticks only enqueue; work runs through the target background operation.

Type Aliases

Type AliasDescription
CronEnqueuer-
CustomLogErrorCallback for handling when a job throws an error.
JobsMapMap of job names to their configurations.

Functions

FunctionDescription
createCronRouterCreates a router that your own Express app can include, in order to serve cron API endpoints. These provide runtime information and the ability do enable/disable cron jobs. They are only accessible to admin users.
runCronRuns the cron jobs until the process is killed. Returns an array of cron jobs.