Skip to content

job/scheduler

Documentation

Overview

Classes

Scheduler

getJobs()

Retrieves all job definitions currently configured in the system.

ts
static getJobs(): void;

Returns

  • Type: void
  • Description: An array of Job objects.

getJob()

Retrieves a specific job definition by its unique name.

ts
static getJob(name: string): Job;
ParameterTypeDescription
namestringThe name of the job.

Returns

  • Type: Job
  • Description: A Job object corresponding to the provided name.

enable()

Enables a job, allowing it to be executed according to its schedule (cron expression).

ts
static enable(name: string): void;
ParameterTypeDescription
namestringThe name of the job to enable.

Returns

  • Type: void
  • Description:

disable()

Disables a job, preventing it from executing on its schedule.

ts
static disable(name: string): void;
ParameterTypeDescription
namestringThe name of the job to disable.

Returns

  • Type: void
  • Description:

trigger()

Triggers the immediate execution of a job.

ts
static trigger(name: string, parameters: any): void;
ParameterTypeDescription
namestringThe name of the job to trigger.
parametersanyOptional key-value object of parameters to pass to the job execution.

Returns

  • Type: void
  • Description:

log()

Logs a message at the standard log level for a specific job instance. This is useful when the log context needs to be associated with a running job.

ts
static log(name: string, message: string): void;
ParameterTypeDescription
namestringThe name of the job to associate the log with.
messagestringThe log message content.

Returns

  • Type: void
  • Description:

error()

Logs an error message for a specific job instance.

ts
static error(name: string, message: string): void;
ParameterTypeDescription
namestringThe name of the job.
messagestringThe error message content.

Returns

  • Type: void
  • Description:

warn()

Logs a warning message for a specific job instance.

ts
static warn(name: string, message: string): void;
ParameterTypeDescription
namestringThe name of the job.
messagestringThe warning message content.

Returns

  • Type: void
  • Description:

info()

Logs an informational message for a specific job instance.

ts
static info(name: string, message: string): void;
ParameterTypeDescription
namestringThe name of the job.
messagestringThe information message content.

Returns

  • Type: void
  • Description: