From 90ca700544f87095b3696323e16e8d05f12a7f1e Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Thu, 17 Jun 2021 16:38:25 +0100 Subject: [PATCH] Fixing an issue with pausing automations. --- packages/server/src/api/controllers/automation.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/server/src/api/controllers/automation.js b/packages/server/src/api/controllers/automation.js index c9c8759fd6..0f2cae40de 100644 --- a/packages/server/src/api/controllers/automation.js +++ b/packages/server/src/api/controllers/automation.js @@ -59,7 +59,7 @@ async function checkForCronTriggers({ appId, oldAuto, newAuto }) { const cronTriggerActivated = isLive(newAuto) && !isLive(oldAuto) - if (cronTriggerRemoved || cronTriggerDeactivated) { + if (cronTriggerRemoved || cronTriggerDeactivated && oldTrigger.cronJobId) { await triggers.automationQueue.removeRepeatableByKey(oldTrigger.cronJobId) } // need to create cron job