CronOptions


interface CronOptions {
  name?: string
  timeZone?: string
  utcOffset?: string | number
  unrefTimeout?: boolean
  disabled?: boolean
}

Properties

Property Description
name?: string

Specify the name of your cron job. This will allow to inject your cron job reference through @InjectCronRef.

timeZone?: string

Specify the timezone for the execution. This will modify the actual time relative to your timezone. If the timezone is invalid, an error is thrown. You can check all timezones available at Moment Timezone Website. Probably don't use both timeZone and utcOffset together or weird things may happen.

utcOffset?: string | number

This allows you to specify the offset of your timezone rather than using the timeZone param. Probably don't use both timeZone and utcOffset together or weird things may happen.

unrefTimeout?: boolean

If you have code that keeps the event loop running and want to stop the node process when that finishes regardless of the state of your cronjob, you can do so making use of this parameter. This is off by default and cron will run as if it needs to control the event loop. For more information take a look at timers#timers_timeout_unref from the NodeJS docs.

disabled?: boolean

This flag indicates whether the job will be executed at all.