@saflib/cron
@saflib/cron
Interfaces
Interface | Description |
---|---|
CronServiceOptions | Options to be passed when starting a cron service. |
CustomLogErrorMeta | Data passed to the error callback. |
JobConfig | Configuration for a single cron job. |
Type Aliases
Type Alias | Description |
---|---|
CustomLogError | Callback for handling when a job throws an error. |
JobsMap | Map of job names to their configurations. |
Functions
Function | Description |
---|---|
createCronRouter | Creates 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. |
runCron | Runs the cron jobs until the process is killed. Returns a DB key you can provide to the cron router to share the same connection. |