Browse Source
Merge pull request #1555 from Budibase/fix/0.9.1-fixes
fix cron trigger output
gh-pages
Martin McKeaveney
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
13 additions and
2 deletions
-
packages/server/src/api/controllers/automation.js
-
packages/server/src/automations/triggers.js
|
|
@ -65,7 +65,10 @@ async function checkForCronTriggers({ appId, oldAuto, newAuto }) { |
|
|
// need to create cron job
|
|
|
// need to create cron job
|
|
|
else if (isCronTrigger(newAuto) && cronTriggerActivated) { |
|
|
else if (isCronTrigger(newAuto) && cronTriggerActivated) { |
|
|
const job = await triggers.automationQueue.add( |
|
|
const job = await triggers.automationQueue.add( |
|
|
{ automation: newAuto, event: { appId } }, |
|
|
{ |
|
|
|
|
|
automation: newAuto, |
|
|
|
|
|
event: { appId, timestamp: Date.now() }, |
|
|
|
|
|
}, |
|
|
{ repeat: { cron: newTrigger.inputs.cron } } |
|
|
{ repeat: { cron: newTrigger.inputs.cron } } |
|
|
) |
|
|
) |
|
|
// Assign cron job ID from bull so we can remove it later if the cron trigger is removed
|
|
|
// Assign cron job ID from bull so we can remove it later if the cron trigger is removed
|
|
|
|
|
|
@ -216,7 +216,15 @@ const BUILTIN_DEFINITIONS = { |
|
|
}, |
|
|
}, |
|
|
required: ["cron"], |
|
|
required: ["cron"], |
|
|
}, |
|
|
}, |
|
|
outputs: {}, |
|
|
outputs: { |
|
|
|
|
|
properties: { |
|
|
|
|
|
timestamp: { |
|
|
|
|
|
type: "number", |
|
|
|
|
|
description: "Timestamp the cron was executed", |
|
|
|
|
|
}, |
|
|
|
|
|
}, |
|
|
|
|
|
required: ["timestamp"], |
|
|
|
|
|
}, |
|
|
}, |
|
|
}, |
|
|
type: "TRIGGER", |
|
|
type: "TRIGGER", |
|
|
}, |
|
|
}, |
|
|
|