Options
All
  • Public
  • Public/Protected
  • All
Menu

Class CronTrigger

Hierarchy

  • CronTrigger

Index

Constructors

constructor

  • The constructor of the CronTrigger

    Parameters

    • trigger: string

      The trigger str used to build the cronTrigger instance

    • job: Job

    Returns CronTrigger

Properties

job

job: Job

nextTime

nextTime: number

trigger

trigger: any

Methods

decodeTimeStr

  • decodeTimeStr(timeStr: any, type: number): -1 | number[]
  • Decode the cron Time string

    Parameters

    • timeStr: any

      The cron time string, like: 1,2 or 1-3

    • type: number

    Returns -1 | number[]

    A sorted array, like [1,2,3]

decodeTrigger

  • decodeTrigger(cronTimeStr: string): any[]
  • Decude the cronTrigger string to arrays

    Parameters

    • cronTimeStr: string

      The cronTimeStr need to decode, like "0 12 * 3"

    Returns any[]

    The array to represent the cronTimer

excuteTime

  • excuteTime(): number

nextExcuteTime

  • nextExcuteTime(time: number): number
  • Caculate the next valid cronTime after the given time

    Parameters

    • time: number

    Returns number

    The nearest valid time after the given time point