diff --git a/app.js b/app.js index 44011f8882..874341c050 100644 --- a/app.js +++ b/app.js @@ -72,6 +72,7 @@ if(nconf.get('upgrade')) { webserver = require('./src/webserver.js'), websockets = require('./src/websockets.js'), plugins = require('./src/plugins'), + reds = require('reds'), admin = { 'categories': require('./src/admin/categories.js') }; @@ -79,6 +80,11 @@ if(nconf.get('upgrade')) { DEVELOPMENT = true; RDB = require('./src/redis.js'); + // Initial setup for Reds + reds.createClient = function() { + return exports.client || (exports.client = RDB); + } + global.configuration = {}; global.templates = {}; @@ -88,7 +94,7 @@ if(nconf.get('upgrade')) { templates.init([ 'header', 'footer', 'logout', 'outgoing', 'admin/header', 'admin/footer', 'admin/index', 'emails/reset', 'emails/reset_plaintext', 'emails/email_confirm', 'emails/email_confirm_plaintext', - 'emails/header', 'emails/footer', 'install/header', 'install/footer', 'install/redis', + 'emails/header', 'emails/footer', 'noscript/header', 'noscript/home', 'noscript/category', 'noscript/topic' ]); diff --git a/src/posts.js b/src/posts.js index 7c3cce1345..5ada90d6e5 100644 --- a/src/posts.js +++ b/src/posts.js @@ -10,9 +10,9 @@ var RDB = require('./redis.js'), async = require('async'), plugins = require('./plugins'), reds = require('reds'), + postSearch = reds.createSearch('nodebbpostsearch'), nconf = require('nconf'), meta = require('./meta.js'), - postSearch = reds.createSearch('nodebbpostsearch'), winston = require('winston'); (function(Posts) {