Skip to content

Commit

Permalink
Merge pull request #23 from hcarneiro/master
Browse files Browse the repository at this point in the history
Microrelease to Production
  • Loading branch information
hcarneiro authored Jun 30, 2019
2 parents 9b2602c + 32ad2af commit 999c68e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 19 deletions.
12 changes: 6 additions & 6 deletions config/database.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const path = require('path')
const Sequelize = require('sequelize')
const env = (process.env.NODE_ENV).toLowerCase()
const config = require(path.resolve( __dirname, './local-config.json'))
const config = require(path.resolve(__dirname, './local-config.json'))
const redis = require('redis')
const bluebird = require('bluebird')
const dev = !(env === 'production')
Expand All @@ -15,15 +15,15 @@ const MAX_LOCK_TIME = 120

const database = {}

database.redis = redis.createClient(!dev ? process.env['REDIS_URL'] : config.redis)
database.redis = redis.createClient(!dev ? process.env.REDIS_URL : config.redis)

const operationsColors = {
INSERT: 32, // green
UPDATE: 33, // yellow
DELETE: 31 // red
DELETE: 31 // red
}

const dbLogging = !!config.query_logging ? function (query) {
const dbLogging = config.query_logging ? function (query) {
let color = 2 // dim

Object.keys(operationsColors).some(function (op) {
Expand All @@ -40,7 +40,7 @@ database.db = new Sequelize(DATABASE_URL, {
logging: dbLogging,
dialect: 'postgres',
dialectOptions: {
ssl: !dev ? true : false
ssl: !dev
},
pool: {
max: 25,
Expand All @@ -49,4 +49,4 @@ database.db = new Sequelize(DATABASE_URL, {
}
})

module.exports = database
module.exports = database
14 changes: 4 additions & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,13 @@
"gm": "^1.23.1",
"helmet": "^3.18.0",
"image-size": "^0.7.4",
"jquery": "^3.4.1",
"lodash": "^4.17.11",
"medium-json-feed": "0.0.3",
"mixitup": "^3.3.1",
"nuxt": "^2.8.1",
"nuxt-webfontloader": "^1.1.0",
"path": "^0.12.7",
"pg": "^7.11.0",
"redis": "^2.8.0",
"sequelize": "^5.9.0",
Expand All @@ -72,11 +75,8 @@
"eslint-plugin-standard": ">=4.0.0",
"eslint-plugin-vue": "^5.2.2",
"babel-core": "7.0.0-bridge.0",
"jquery": "^3.4.1",
"mixitup": "^3.3.1",
"node-sass": "^4.12.0",
"nodemon": "^1.19.1",
"path": "^0.12.7",
"sass-loader": "^7.1.0"
},
"engines": {
Expand Down

0 comments on commit 999c68e

Please sign in to comment.