mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-02 20:16:04 +01:00
fix redis export
This commit is contained in:
@@ -7,8 +7,9 @@ var EventEmitter = require('events').EventEmitter;
|
||||
|
||||
var channelName;
|
||||
|
||||
var PubSub = function (db) {
|
||||
var PubSub = function () {
|
||||
var self = this;
|
||||
var db = require('../redis');
|
||||
var subClient = 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 }));
|
||||
};
|
||||
|
||||
module.exports = function () {
|
||||
var db = require('../redis');
|
||||
return new PubSub(db);
|
||||
};
|
||||
module.exports = new PubSub();
|
||||
|
||||
Reference in New Issue
Block a user