From 385311ccc5d8095fff7e6998f4a72a0f73c0df13 Mon Sep 17 00:00:00 2001 From: Robert Michalski Date: Tue, 26 Nov 2019 16:49:08 +0100 Subject: [PATCH] Added support for Redis password --- .env.example | 1 + retry_failed_jobs.js | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/.env.example b/.env.example index b76f665..31bc6d2 100644 --- a/.env.example +++ b/.env.example @@ -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" diff --git a/retry_failed_jobs.js b/retry_failed_jobs.js index 860ff18..6cc96ac 100644 --- a/retry_failed_jobs.js +++ b/retry_failed_jobs.js @@ -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: { @@ -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) {