Class: TimeoutJobDefinition
A class representing a timeout job definition.
Extends
Constructors
Constructor
new TimeoutJobDefinition(
name,timeout,execute,initiallyDisabled?):TimeoutJobDefinition
Parameters
name
string
timeout
number
execute
() => Promise<void>
initiallyDisabled?
boolean
Returns
TimeoutJobDefinition
Overrides
Properties
initiallyDisabled
readonlyinitiallyDisabled:boolean=false
Inherited from
JobDefinition.initiallyDisabled
lastExecutionTime?
protectedoptionallastExecutionTime?:Date
Inherited from
JobDefinition.lastExecutionTime
name
readonlyname:string
Inherited from
trigger
protectedreadonlytrigger:JobTrigger
Overrides
type
readonlytype:JobType=JobType.Timeout
Overrides
Methods
changeTrigger()
protectedchangeTrigger(trigger):void
Parameters
trigger
Returns
void
Inherited from
execute()
execute():
Promise<void>
Executes the job.
Returns
Promise<void>
A promise resolving when the job has been executed.
Inherited from
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.
Inherited from
JobDefinition.getLastExecutionTime
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.
Inherited from
JobDefinition.getNextExecutionTime
updateTimeout()
updateTimeout(
timeout):void
Updates the timeout for the job.
Parameters
timeout
number
The new timeout.
Returns
void
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
The created job definition.