Abstract Class: JobDefinition
An abstract class representing a job definition.
Extended by
Implements
Constructors
Constructor
new JobDefinition(
name,job,initiallyDisabled?):JobDefinition
Parameters
name
string
job
() => Promise<void>
initiallyDisabled?
boolean = false
Returns
JobDefinition
Properties
initiallyDisabled
readonlyinitiallyDisabled:boolean=false
lastExecutionTime?
protectedoptionallastExecutionTime?:Date
name
readonlyname:string
trigger
abstractprotectedtrigger:JobTrigger
type
abstractreadonlytype:JobType
Methods
changeTrigger()
protectedchangeTrigger(trigger):void
Parameters
trigger
Returns
void
execute()
execute():
Promise<void>
Executes the job.
Returns
Promise<void>
A promise resolving when the job has been executed.
Implementation of
getLastExecutionTime()
getLastExecutionTime():
Date|undefined
Gets the last execution time of the job.
Returns
Date | undefined
The last execution time, or undefined if the job has not been executed yet.
getNextExecutionTime()
getNextExecutionTime():
Date|undefined
Gets the next execution time of the job.
Returns
Date | undefined
The next execution time, or undefined if the job has no more executions.
fromMetadata()
staticfromMetadata(metadata,execute):JobDefinition
Creates a job definition from metadata.
Parameters
metadata
The metadata for the job.
execute
() => Promise<void>
The function to execute when the job runs.
Returns
JobDefinition
The created job definition.