@ckirg/corelib - v0.4.1
    Preparing search index...

    Function includeExcludeCron

    • Run a handler when ANY include cron matches AND NONE of the exclude crons match.

      Supports 6-field cron expressions (seconds). The expressions are validated and compiled once, so an invalid one throws here rather than inside the timer. The schedule is polled every second against the wall clock: a second skipped by a stalled event loop is not replayed, and a handler that takes longer than a second can overlap with the next run.

      A handler that throws (or returns a rejected promise) does not stop the job or crash the process: the error goes to onError, or is logged when none is given.

      Parameters

      • includeExprs: string[]
      • excludeExprs: string[]
      • handler: () => void
      • Optionaltimezone: string

        Optional IANA timezone name (e.g. "America/New_York"). Pattern matching uses the wall-clock time in that zone. Defaults to the local system timezone when omitted.

      • OptionalonError: (error: unknown) => void

      Returns Cron<undefined>