mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-03 12:36:02 +01:00
fix redis export
This commit is contained in:
@@ -7,8 +7,9 @@ var EventEmitter = require('events').EventEmitter;
|
|||||||
|
|
||||||
var channelName;
|
var channelName;
|
||||||
|
|
||||||
var PubSub = function (db) {
|
var PubSub = function () {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
var db = require('../redis');
|
||||||
var subClient = db.connect();
|
var subClient = db.connect();
|
||||||
this.pubClient = db.connect();
|
this.pubClient = db.connect();
|
||||||
|
|
||||||
@@ -35,7 +36,4 @@ PubSub.prototype.publish = function (event, data) {
|
|||||||
this.pubClient.publish(channelName, JSON.stringify({ event: event, data: data }));
|
this.pubClient.publish(channelName, JSON.stringify({ event: event, data: data }));
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = function () {
|
module.exports = new PubSub();
|
||||||
var db = require('../redis');
|
|
||||||
return new PubSub(db);
|
|
||||||
};
|
|
||||||
|
|||||||
Reference in New Issue
Block a user