fix redis export

v1.18.x
Barış Soner Uşaklı 7 years ago
parent 8a6345ded7
commit c0b7d4f5b5

@ -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);
};

Loading…
Cancel
Save