fix(workflow-engine-*): scheduled jobs interval (#11800)
**What**
Currently only cron pattern are supported by scheduled jobs, this can lead to issue. for example you set the pattern to execute every hours at minute 0 and second 0 (as it is expected to execute at exactly this constraint) but due to the moment it gets executed we our out of the second 0 then the job wont get executed until the next scheduled cron table execution.
With this pr we introduce the `interval` configuration which allows you the specify a delay between execution in ms (e.g every minute -> 60 * 1000 ms) which ensure that once a job is executed another one is scheduled for a minute later.
**Usage**
```ts
// jobs/job-1.ts
const thirtySeconds = 30 * 1000
export const config = {
name: "job-1",
schedule: {
interval: thirtySeconds
},
}
```
This commit is contained in:
committed by
GitHub
parent
e05491c24f
commit
fc652ea51e
@@ -11,7 +11,7 @@ import { ResourceLoader } from "../utils/resource-loader"
|
||||
|
||||
type CronJobConfig = {
|
||||
name: string
|
||||
schedule: string
|
||||
schedule: string | SchedulerOptions
|
||||
numberOfExecutions?: SchedulerOptions["numberOfExecutions"]
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user