Fix restarted secondary instances waiting forever for the templates:compiled message. Fix update notification always appearing when an instance restarts even if there was no update. Closes #4870 (#4871)

v1.18.x
Ben Lubar 9 years ago committed by Julian Lam
parent a80801e856
commit b08696515f

@ -29,7 +29,8 @@ var pidFilePath = __dirname + '/pidfile',
css: {
cache: undefined,
acpCache: undefined
}
},
templatesCompiled: false
};
Loader.init = function(callback) {
@ -112,6 +113,12 @@ Loader.addWorkerEvents = function(worker) {
});
}
if (Loader.templatesCompiled && !worker.isPrimary) {
worker.send({
action: 'templates:compiled'
});
}
break;
case 'restart':
@ -141,6 +148,8 @@ Loader.addWorkerEvents = function(worker) {
}, worker.pid);
break;
case 'templates:compiled':
Loader.templatesCompiled = true;
Loader.notifyWorkers({
action: 'templates:compiled',
}, worker.pid);

@ -56,8 +56,8 @@ app.cacheBuster = null;
socket.removeAllListeners('event:nodebb.ready');
socket.on('event:nodebb.ready', function(data) {
if (!app.cacheBusters || app.cacheBusters['cache-buster'] !== data['cache-buster']) {
app.cacheBusters = data;
if (!app.cacheBuster || app.cacheBuster !== data['cache-buster']) {
app.cacheBuster = data['cache-buster'];
app.alert({
alert_id: 'forum_updated',

Loading…
Cancel
Save