only triggering forum updated messaging if hostname matches, fixes #6333

v1.18.x
Julian Lam 7 years ago
parent 9a1f722a05
commit a4a961639d

@ -75,7 +75,7 @@ app.cacheBuster = null;
socket.removeAllListeners('event:nodebb.ready');
socket.on('event:nodebb.ready', function (data) {
if (!app.cacheBuster || app.cacheBuster !== data['cache-buster']) {
if ((data.hostname === app.upstreamHost) && (!app.cacheBuster || app.cacheBuster !== data['cache-buster'])) {
app.cacheBuster = data['cache-buster'];
app.alert({

@ -34,6 +34,10 @@ app.isConnected = false;
}
});
socket.on('setHostname', function (hostname) {
app.upstreamHost = hostname;
});
socket.on('event:banned', onEventBanned);
socket.on('event:alert', app.alert);

@ -1,5 +1,6 @@
'use strict';
var os = require('os');
var async = require('async');
var nconf = require('nconf');
var winston = require('winston');
@ -84,6 +85,7 @@ function onConnect(socket) {
socket.join('sess_' + socket.request.signedCookies[nconf.get('sessionKey')]);
io.sockets.sockets[socket.id].emit('checkSession', socket.uid);
io.sockets.sockets[socket.id].emit('setHostname', os.hostname());
}
function onMessage(socket, payload) {

@ -3,6 +3,7 @@
var fs = require('fs');
var path = require('path');
var os = require('os');
var nconf = require('nconf');
var express = require('express');
var app = express();
@ -72,6 +73,7 @@ module.exports.listen = function (callback) {
require('./socket.io').server.emit('event:nodebb.ready', {
'cache-buster': meta.config['cache-buster'],
hostname: os.hostname(),
});
plugins.fireHook('action:nodebb.ready');

Loading…
Cancel
Save