diff --git a/src/cloudron.js b/src/cloudron.js index 3b15d7ae7..e7a20297f 100644 --- a/src/cloudron.js +++ b/src/cloudron.js @@ -115,7 +115,6 @@ function initialize(callback) { if (process.env.BOX_ENV !== 'test') { exports.events.on(exports.EVENT_ACTIVATED, addDnsRecords); - exports.events.on(exports.EVENT_ACTIVATED, sendHeartbeat); // optmization for not waiting till the next 1-min } userdb.count(function (error, count) { diff --git a/src/cron.js b/src/cron.js index 29e945591..662c4c8b8 100644 --- a/src/cron.js +++ b/src/cron.js @@ -46,8 +46,10 @@ function initialize(callback) { settings.events.on(settings.AUTOUPDATE_PATTERN_KEY, autoupdatePatternChanged); cloudron.events.on(cloudron.EVENT_ACTIVATED, recreateJobs); + cloudron.events.on(cloudron.EVENT_ACTIVATED, cloudron.sendHeartbeat); // send heartbeats regardless of activation + cloudron.sendHeartbeat(); gHeartbeatJob = new CronJob({ cronTime: '00 */1 * * * *', // every minute onTick: cloudron.sendHeartbeat, @@ -56,7 +58,11 @@ function initialize(callback) { gInitialized = true; - if (cloudron.isActivatedSync()) recreateJobs(callback); else callback(); + if (cloudron.isActivatedSync()) { + recreateJobs(callback); + } else { + callback(); + } } function recreateJobs(unusedTimeZone, callback) {