emit platform ready timer only if platform succeeded
This commit is contained in:
@@ -59,16 +59,20 @@ function initialize(callback) {
|
||||
loadAddonVars,
|
||||
mailboxes.setupAliases,
|
||||
fs.writeFile.bind(fs, paths.INFRA_VERSION_FILE, JSON.stringify(infra))
|
||||
], callback);
|
||||
], function (error) {
|
||||
if (error) return callback(error);
|
||||
|
||||
// give 30 seconds for the platform to "settle". For example, mysql might still be initing the
|
||||
// database dir and we cannot call service scripts until that's done.
|
||||
// TODO: make this smarter to not wait for 30secs for the crash-restart case
|
||||
gPlatformReadyTimer = setTimeout(function () {
|
||||
debug('emitting platform ready');
|
||||
gPlatformReadyTimer = null;
|
||||
exports.events.emit(exports.EVENT_READY);
|
||||
}, 30000);
|
||||
// give 30 seconds for the platform to "settle". For example, mysql might still be initing the
|
||||
// database dir and we cannot call service scripts until that's done.
|
||||
// TODO: make this smarter to not wait for 30secs for the crash-restart case
|
||||
gPlatformReadyTimer = setTimeout(function () {
|
||||
debug('emitting platform ready');
|
||||
gPlatformReadyTimer = null;
|
||||
exports.events.emit(exports.EVENT_READY);
|
||||
}, 30000);
|
||||
|
||||
callback();
|
||||
});
|
||||
}
|
||||
|
||||
function uninitialize(callback) {
|
||||
|
||||
Reference in New Issue
Block a user