job/scheduler
Documentation
- source: job/scheduler.ts
Overview
Classes
Scheduler
getJobs()
Retrieves all job definitions currently configured in the system.
tsstatic getJobs(): void;Returns
- Type:
void- Description: An array of Job objects.
getJob()
Retrieves a specific job definition by its unique name.
tsstatic getJob(name: string): Job;
Parameter Type Description 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).
tsstatic enable(name: string): void;
Parameter Type Description namestringThe name of the job to enable. Returns
- Type:
void- Description:
disable()
Disables a job, preventing it from executing on its schedule.
tsstatic disable(name: string): void;
Parameter Type Description namestringThe name of the job to disable. Returns
- Type:
void- Description:
trigger()
Triggers the immediate execution of a job.
tsstatic trigger(name: string, parameters: any): void;
Parameter Type Description 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.
tsstatic log(name: string, message: string): void;
Parameter Type Description 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.
tsstatic error(name: string, message: string): void;
Parameter Type Description namestringThe name of the job. messagestringThe error message content. Returns
- Type:
void- Description:
warn()
Logs a warning message for a specific job instance.
tsstatic warn(name: string, message: string): void;
Parameter Type Description namestringThe name of the job. messagestringThe warning message content. Returns
- Type:
void- Description:
info()
Logs an informational message for a specific job instance.
tsstatic info(name: string, message: string): void;
Parameter Type Description namestringThe name of the job. messagestringThe information message content. Returns
- Type:
void- Description:
