send heartbeats regardless of activation

This commit is contained in:
Girish Ramakrishnan
2015-10-27 16:05:19 -07:00
parent e36a0b9a30
commit 3ac3207497

View File

@@ -47,6 +47,13 @@ function initialize(callback) {
cloudron.events.on(cloudron.EVENT_ACTIVATED, recreateJobs);
// send heartbeats regardless of activation
gHeartbeatJob = new CronJob({
cronTime: '00 */1 * * * *', // every minute
onTick: cloudron.sendHeartbeat,
start: true
});
gInitialized = true;
callback();
@@ -58,14 +65,6 @@ function recreateJobs(unusedTimeZone, callback) {
settings.getAll(function (error, allSettings) {
debug('Creating jobs with timezone %s', allSettings[settings.TIME_ZONE_KEY]);
if (gHeartbeatJob) gHeartbeatJob.stop();
gHeartbeatJob = new CronJob({
cronTime: '00 */1 * * * *', // every minute
onTick: cloudron.sendHeartbeat,
start: true,
timeZone: allSettings[settings.TIME_ZONE_KEY]
});
if (gBackupJob) gBackupJob.stop();
gBackupJob = new CronJob({
cronTime: '00 00 */4 * * *', // every 4 hours