mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-20 15:30:39 +01:00
Fix socket.io not working properly in single-host clusters. (#6669)
This is because we don't use the cluster module, so the master nodejs process doesn't know about any of the clients through the socket API.
This commit is contained in:
committed by
Barış Soner Uşaklı
parent
e534bf803e
commit
44373afc52
@@ -28,7 +28,9 @@ Sockets.init = function (server) {
|
||||
});
|
||||
|
||||
if (nconf.get('singleHostCluster')) {
|
||||
io.adapter(require('socket.io-adapter-cluster')());
|
||||
io.adapter(require('socket.io-adapter-cluster')({
|
||||
client: require('./single-host-cluster'),
|
||||
}));
|
||||
} else if (nconf.get('redis')) {
|
||||
io.adapter(require('../database/redis').socketAdapter());
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user