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,