Make it possible to trigger all X minutes/hours

This commit is contained in:
Jan Oberhauser
2019-12-31 17:41:47 -06:00
parent 2f56561bff
commit 8f25303928
3 changed files with 120 additions and 8 deletions

View File

@@ -134,6 +134,14 @@ export class ActiveWorkflows {
cronTimes.push(`${Math.floor(Math.random() * 60).toString()} * * * * *`);
continue;
}
if (item.mode === 'everyX') {
if (item.unit === 'minutes') {
cronTimes.push(`${Math.floor(Math.random() * 60).toString()} */${item.value} * * * *`);
} else if (item.unit === 'hours') {
cronTimes.push(`${Math.floor(Math.random() * 60).toString()} 0 */${item.value} * * *`);
}
continue;
}
for (parameterName of parameterOrder) {
if (item[parameterName] !== undefined) {