From 437312811d7e1bfc3b8f21861245d5a1877f2fb9 Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Mon, 27 Nov 2017 15:41:24 -0800 Subject: [PATCH] wrap seconds --- src/cron.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/cron.js b/src/cron.js index ef10c6b33..9988caa30 100644 --- a/src/cron.js +++ b/src/cron.js @@ -59,6 +59,8 @@ function initialize(callback) { // hack: send the first heartbeat only after we are running for 60 seconds // required as we end up sending a heartbeat and then cloudron-setup reboots the server var seconds = (new Date()).getSeconds() - 1; + if (seconds === -1) seconds = 59; + gJobs.caasHeartbeat = new CronJob({ cronTime: `${seconds} */1 * * * *`, // every minute onTick: cloudron.sendCaasHeartbeat,