🔀 Merge branch 'RicardoE105-feature/cronnode-every-minute'

This commit is contained in:
Jan Oberhauser 2019-11-13 07:47:38 +01:00
commit 4ab9e1cf28

View file

@ -53,6 +53,10 @@ export class Cron implements INodeType {
name: 'mode', name: 'mode',
type: 'options', type: 'options',
options: [ options: [
{
name: 'Every Minute',
value: 'everyMinute'
},
{ {
name: 'Every Hour', name: 'Every Hour',
value: 'everyHour' value: 'everyHour'
@ -90,6 +94,7 @@ export class Cron implements INodeType {
mode: [ mode: [
'custom', 'custom',
'everyHour', 'everyHour',
'everyMinute'
], ],
}, },
}, },
@ -108,6 +113,7 @@ export class Cron implements INodeType {
hide: { hide: {
mode: [ mode: [
'custom', 'custom',
'everyMinute'
], ],
}, },
}, },
@ -226,6 +232,10 @@ export class Cron implements INodeType {
cronTimes.push(item.cronExpression as string); cronTimes.push(item.cronExpression as string);
continue; continue;
} }
if (item.mode === 'everyMinute') {
cronTimes.push(`${Math.floor(Math.random() * 60).toString()} * * * * *`);
continue;
}
for (parameterName of parameterOrder) { for (parameterName of parameterOrder) {
if (item[parameterName] !== undefined) { if (item[parameterName] !== undefined) {