A logger for the cron system to use
Optional initWait: Promise<unknown>An optional promise used to await initialization of cronjobs
Optional onShutdown: ((task) => void)An optional function used to shut down all cronjobs on service shutdown
Protected crontabTracks active cronjobs
Protected readyCaptures the initialization timeout
Protected logA logger for the cron system to use
Protected Optional initAn optional promise used to await initialization of cronjobs
Registers cron jobs in the crontab and initializes them if the service is ready
Protected initGenerated using TypeDoc
A cronjob manager. This class is used by the cron weenie function to manage cronjobs. It can also be used directly.
Note that if this class is used in conjunction with weenie's serviceManager, it will kill all cronjobs on SIGINT and SIGTERM (if the serviceManager is configured to handle those signals).
Additionally note that you can delay the registering and starting of cronjobs until all dependencies are successfully registered and initialized by passing a promise to the constructor. If you don't pass a promise, cronjobs that are registered will be started immediately.