mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-11 04:47:29 -08:00
⚡ Do not allow shorter polling-times than 1 minute
This commit is contained in:
parent
a800a84078
commit
e327bfcb91
|
@ -127,7 +127,7 @@ export class ActiveWorkflows {
|
|||
for (const item of pollTimes.item) {
|
||||
cronTime = [];
|
||||
if (item.mode === 'custom') {
|
||||
cronTimes.push(item.cronExpression as string);
|
||||
cronTimes.push((item.cronExpression as string).trim());
|
||||
continue;
|
||||
}
|
||||
if (item.mode === 'everyMinute') {
|
||||
|
@ -178,6 +178,11 @@ export class ActiveWorkflows {
|
|||
// Start the cron-jobs
|
||||
const cronJobs: CronJob[] = [];
|
||||
for (const cronTime of cronTimes) {
|
||||
const cronTimeParts = cronTime.split(' ');
|
||||
if (cronTimeParts.length > 0 && cronTimeParts[0].includes('*')) {
|
||||
throw new Error('The polling interval is too short. It has to be at least a minute!');
|
||||
}
|
||||
|
||||
cronJobs.push(new CronJob(cronTime, executeTrigger, undefined, true, timezone));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue