mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-23 17:00:24 +01:00
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)
This commit is contained in:
11
loader.js
11
loader.js
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user