From c0b7d4f5b5feca2b70e31b049cf6a60ff1cac6ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Mon, 22 Jan 2018 16:51:12 -0500 Subject: [PATCH] fix redis export --- src/database/redis/pubsub.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/database/redis/pubsub.js b/src/database/redis/pubsub.js index f7724bb016..cb989207a6 100644 --- a/src/database/redis/pubsub.js +++ b/src/database/redis/pubsub.js @@ -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();