Skip to content

@saflib/cron


@saflib/cron

Interfaces

InterfaceDescription
CronServiceOptionsOptions to be passed when starting a cron service.
CustomLogErrorMetaData passed to the error callback.
JobConfigConfiguration for a single cron job.

Type Aliases

Type AliasDescription
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 a DB key you can provide to the cron router to share the same connection.