Changed the minimum interval time period from 60s to 20s (with changeset)
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@trigger.dev/core": patch
|
||||
---
|
||||
|
||||
Changed the minimum interval time period from 60s to 20s
|
||||
@@ -103,11 +103,11 @@ function validateSchedule(schedule: ScheduleMetadata): ScheduleMetadata {
|
||||
}
|
||||
|
||||
function validateInterval(schedule: IntervalMetadata): ScheduleMetadata {
|
||||
if (schedule.options.seconds < 60) {
|
||||
if (schedule.options.seconds < 20) {
|
||||
return {
|
||||
type: "interval",
|
||||
options: {
|
||||
seconds: 60,
|
||||
seconds: 20,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ description: "`intervalTrigger()` is set as a [Job's trigger](/sdk/job) to trigg
|
||||
Intervals are set with a number of seconds. There are some important considerations:
|
||||
|
||||
- The Job will first run the specified number of seconds after it has first connected to an [Environment](/documentation/concepts/environments-endpoints). This will happen when you first [deploy](/documentation/guides/deployment) that Job.
|
||||
- The minimum interval is 60 seconds (any input less than this it will default to 60).
|
||||
- The minimum interval is 20 seconds (any input less than this it will default to 20).
|
||||
- The maximum interval is 2_592_000 seconds (30 days), if you pass more than this it will trigger every 30 days.
|
||||
|
||||
If you wish to Run a Job at an exact time or less frequently than once pr day you should use a [cronTrigger()](/sdk/crontrigger) instead.
|
||||
|
||||
@@ -10,8 +10,8 @@ export const ScheduledPayloadSchema = z.object({
|
||||
export type ScheduledPayload = z.infer<typeof ScheduledPayloadSchema>;
|
||||
|
||||
export const IntervalOptionsSchema = z.object({
|
||||
/** The number of seconds for the interval. Min = 60, Max = 2_592_000 (30 days) */
|
||||
seconds: z.number().int().positive().min(60).max(2_592_000),
|
||||
/** The number of seconds for the interval. Min = 20, Max = 2_592_000 (30 days) */
|
||||
seconds: z.number().int().positive().min(20).max(2_592_000),
|
||||
});
|
||||
|
||||
/** Interval options */
|
||||
|
||||
Reference in New Issue
Block a user