mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
fix(core): Protect against duplicate cron registration (#18005)
This commit is contained in:
@@ -843,7 +843,7 @@ type CronUnit = number | '*' | `*/${number}`;
|
||||
export type CronExpression =
|
||||
`${CronUnit} ${CronUnit} ${CronUnit} ${CronUnit} ${CronUnit} ${CronUnit}`;
|
||||
|
||||
type RecurrenceRule =
|
||||
type CronRecurrenceRule =
|
||||
| { activated: false }
|
||||
| {
|
||||
activated: true;
|
||||
@@ -852,7 +852,15 @@ type RecurrenceRule =
|
||||
typeInterval: 'hours' | 'days' | 'weeks' | 'months';
|
||||
};
|
||||
|
||||
export type Cron = { expression: CronExpression; recurrence?: RecurrenceRule };
|
||||
export type CronContext = {
|
||||
nodeId: string;
|
||||
workflowId: string;
|
||||
timezone: string;
|
||||
expression: CronExpression;
|
||||
recurrence?: CronRecurrenceRule;
|
||||
};
|
||||
|
||||
export type Cron = { expression: CronExpression; recurrence?: CronRecurrenceRule };
|
||||
|
||||
export interface SchedulingFunctions {
|
||||
registerCron(cron: Cron, onTick: () => void): void;
|
||||
|
||||
Reference in New Issue
Block a user