mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-08 15:05:46 +01:00
check if process.send exists
This commit is contained in:
@@ -18,11 +18,15 @@ function get() {
|
||||
} else if (nconf.get('singleHostCluster')) {
|
||||
pubsub = new EventEmitter();
|
||||
pubsub.publish = function (event, data) {
|
||||
if (process.send) {
|
||||
process.send({
|
||||
action: 'pubsub',
|
||||
event: event,
|
||||
data: data,
|
||||
});
|
||||
} else {
|
||||
pubsub.emit(event, data);
|
||||
}
|
||||
};
|
||||
process.on('message', function (message) {
|
||||
if (message && typeof message === 'object' && message.action === 'pubsub') {
|
||||
|
||||
Reference in New Issue
Block a user