sendHeartbeat on activation event

This commit is contained in:
Girish Ramakrishnan
2015-10-27 16:20:14 -07:00
parent 140aa85223
commit 87e70b86d3

View File

@@ -115,6 +115,7 @@ 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) {
@@ -296,8 +297,6 @@ function sendHeartbeat() {
}
function addDnsRecords() {
if (config.dnsInSync()) return sendHeartbeat(); // already registered send heartbeat
var DKIM_SELECTOR = 'mail';
var DMARC_REPORT_EMAIL = 'dmarc-report@cloudron.io';
@@ -354,7 +353,6 @@ function addDnsRecords() {
}
debug('addDnsRecords: done');
config.setDnsInSync('DNS is in sync for ip ' + sysinfo.getIp());
sendHeartbeat(); // send heartbeat after the dns records are done
});
}