cron-vir - v1.4.0
    Preparing search index...

    Class RunningCrons<Context, Name>

    The return class from running cron jobs. Can be used to pause all crons, receive events, start specific crons, etc.

    Type Parameters

    • Context
    • Name extends string

    Hierarchy

    Index

    Constructors

    Properties

    context: Context
    crons: readonly Readonly<CronDefinition<Context, Name>>[]
    cronStatuses: {
        [key: string]: {
            inFlight: boolean;
            missedCount: number;
            paused: boolean;
        };
    } = {}
    lastExecutionTimes: Partial<{ [CronName in string]: FullDate | undefined }> = {}
    log: LoggerLogs
    options: Readonly<RunningCronsOptions> = {}
    timeouts: { [key: string]: Readonly<Timeout> | undefined } = {}
    uncaughtExceptionMonitorHandler: AnyFunction | undefined
    unhandledRejectionHandler: AnyFunction | undefined

    Methods

    • Clean up resources and stop all crons.

      Returns void

    • Pause all cron jobs. This does not affect any currently running crons. It merely prevents the next scheduled executions from running.

      Returns void

    • Pause a specific cron job. This does not affect any currently running jobs for the cron. It merely prevents the next scheduled execution from running.

      Parameters

      Returns boolean

      false if no cron by the given name was found or if the cron was already paused.

    • Resume a specific cron job.

      Parameters

      Returns boolean

      false if no cron by the given name was found or if the cron was already resumed.

    • Set the next iteration of the given cron.

      Parameters

      Returns boolean