core-utils
    Preparing search index...
    Index

    Constructors

    Properties

    jobModel: Model<BackgroundJobType<unknown>>
    jobsRepo: JobsRepository
    registry: Registry
    scheduleModel: Model<ScheduleType<unknown>>

    Methods

    • Cancel jobs

      This method will remove jobs with given ids from the DB. So if the job is scheduled and waiting to be run then you would prevent the job from being executed in the future. If you call this method while the job is currently running then you won't affect the current execution of the job but you will prevent the job from being executed again in the future (in case it failed)

      Parameters

      • jobIds: string[]
      • options: SessionOptions = {}

      Returns Promise<void>

    • Type Parameters

      • T

      Parameters

      • handlerClassOrInstance: InstantiableHandlerClassOrInstance<T>
      • group: string

      Returns void

    • Type Parameters

      • T

      Parameters

      • handlerClassOrInstance: InstantiableHandlerClassOrInstance<T>
      • options: RegisterCronOptions<T>

      Returns Promise<void>

    • Retry a job by id

      This method is useful if you have a job that exhausted its attempts limit but you want to run it again. By calling this method you will bring the attempts count of the job to 0 and set the next run time to current time (so the job will be picked up as soon as possible).

      Parameters

      • jobId: string

      Returns Promise<void>