From a72674ffd665db7fe519f2a51cc7f659d3cd33fc Mon Sep 17 00:00:00 2001 From: Benjamin Delamarre Date: Tue, 7 Feb 2017 14:34:03 +0100 Subject: [PATCH] feat(deploy): Add Heroku config (#68) * fix(config): Fixed config for Heroku * fix(config): Fixed config for Heroku * fix(config): Fixed config for Heroku * fix(config): Fixed config for Heroku * feat(heroku): Fix port in config --- config/development.js | 8 +++++--- config/production.js | 9 ++++----- config/test.js | 8 +++++--- server/tasks/index.js | 8 ++------ 4 files changed, 16 insertions(+), 17 deletions(-) diff --git a/config/development.js b/config/development.js index 8903abf..a8da2fb 100644 --- a/config/development.js +++ b/config/development.js @@ -15,9 +15,11 @@ module.exports = { database: 'lvconnect', }, kue: { - host: 'localhost', - port: 6379, - db: 0, + redis: { + host: 'localhost', + port: 6379, + db: 0, + }, prefix: 'lvc-kue', config: { shutdownTimeout: 5000, diff --git a/config/production.js b/config/production.js index 4332bdb..a3f449c 100644 --- a/config/production.js +++ b/config/production.js @@ -17,14 +17,14 @@ module.exports = { cache: { name: 'redisCache', engine: 'catbox-redis', - host: process.env.REDIS_URL, + socket: process.env.REDIS_URL, database: 0, partition: 'lvc-cache', }, }, host: { - hostname: 'lvconnect.link-value.fr', - port: 8000, + hostname: 'localhost', + port: process.env.PORT || 8000, }, mongodb: { host: 'ds145039.mlab.com', @@ -34,8 +34,7 @@ module.exports = { password: '4lqc04tkc8n4oogo873im9eo4o', }, kue: { - host: process.env.REDIS_URL, - db: 0, + redis: `${process.env.REDIS_URL}/1`, prefix: 'lvc-kue', }, logs: { diff --git a/config/test.js b/config/test.js index 94166b5..abec11c 100644 --- a/config/test.js +++ b/config/test.js @@ -15,9 +15,11 @@ module.exports = { database: 'lvconnect_test', }, kue: { - host: 'localhost', - port: 6379, - db: 0, + redis: { + host: 'localhost', + port: 6379, + db: 0, + }, prefix: 'lvc-kue', config: { shutdownTimeout: 5000, diff --git a/server/tasks/index.js b/server/tasks/index.js index 8dc2ba7..6b59e87 100644 --- a/server/tasks/index.js +++ b/server/tasks/index.js @@ -2,14 +2,10 @@ const kue = require('kue'); const workers = require('./workers'); -exports.register = (server, { host, port, db, prefix, config }, next) => { +exports.register = (server, { redis, prefix, config }, next) => { const queue = kue.createQueue({ prefix, - redis: { - port, - host, - db, - }, + redis, }); server.on('stop', () => queue.shutdown(config.shutdownTimeout, (err) => {