wrap seconds

This commit is contained in:
Girish Ramakrishnan
2017-11-27 15:41:24 -08:00
parent 68d4e70823
commit 437312811d
+2
View File
@@ -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,