Skip to content

Commit

Permalink
Added support for Redis password
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Michalski committed Nov 26, 2019
1 parent 8608ff5 commit 385311c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ NODE_ENV=production
REDIS_HOST=127.0.0.1
REDIS_PORT=6379
REDIS_DATABASE=0
#REDIS_PASS=

SLACK_WEBHOOK_URL=https://hooks.slack.com/services/...
SLACK_CHANNEL="#my-channel"
5 changes: 5 additions & 0 deletions retry_failed_jobs.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const { forEach, reduce } = require('p-iteration')
const REDIS_PORT = Number.parseInt(process.env.REDIS_PORT) || 6379
const REDIS_HOST = process.env.REDIS_HOST || '127.0.0.1'
const REDIS_DATABASE = Number.parseInt(process.env.REDIS_DATABASE) || 0
const REDIS_PASS = process.env.REDIS_PASS

const REDIS_CONFIG = {
redis: {
Expand All @@ -19,6 +20,10 @@ const REDIS_CONFIG = {
}
}

if (REDIS_PASS) {
REDIS_CONFIG.redis.password = REDIS_PASS
}

const args = process.argv.slice(2)

if (args.length < 1) {
Expand Down

0 comments on commit 385311c

Please sign in to comment.