1
0
Fork 0
mirror of synced 2024-07-05 06:20:55 +12:00

fix cron trigger output

This commit is contained in:
Martin McKeaveney 2021-05-25 13:39:30 +01:00
parent b923b63a44
commit 0340c735e8
2 changed files with 13 additions and 2 deletions

View file

@ -65,7 +65,10 @@ async function checkForCronTriggers({ appId, oldAuto, newAuto }) {
// need to create cron job
else if (isCronTrigger(newAuto) && cronTriggerActivated) {
const job = await triggers.automationQueue.add(
{ automation: newAuto, event: { appId } },
{
automation: newAuto,
event: { appId, timestamp: Date.now() },
},
{ repeat: { cron: newTrigger.inputs.cron } }
)
// Assign cron job ID from bull so we can remove it later if the cron trigger is removed

View file

@ -216,7 +216,15 @@ const BUILTIN_DEFINITIONS = {
},
required: ["cron"],
},
outputs: {},
outputs: {
properties: {
timestamp: {
type: "number",
description: "Timestamp the cron was executed",
},
},
required: ["timestamp"],
},
},
type: "TRIGGER",
},