Skip to content

Commit

Permalink
feat(core): Add compatibility to redis > 6 ACLs system using username…
Browse files Browse the repository at this point in the history
… in queue-mode (#5048)

feat(redis): add compatibility to redis > 6 ACLs system using username

Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <[email protected]>
  • Loading branch information
intel44 and netroy authored Jan 3, 2023
1 parent e1f9349 commit 0ec66bf
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/cli/src/commands/start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,7 @@ export class Start extends Command {

if (config.getEnv('executions.mode') === 'queue') {
const redisHost = config.getEnv('queue.bull.redis.host');
const redisUsername = config.getEnv('queue.bull.redis.username');
const redisPassword = config.getEnv('queue.bull.redis.password');
const redisPort = config.getEnv('queue.bull.redis.port');
const redisDB = config.getEnv('queue.bull.redis.db');
Expand Down Expand Up @@ -383,6 +384,9 @@ export class Start extends Command {
if (redisHost) {
settings.host = redisHost;
}
if (redisUsername) {
settings.username = redisUsername;
}
if (redisPassword) {
settings.password = redisPassword;
}
Expand Down
4 changes: 4 additions & 0 deletions packages/cli/src/commands/webhook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ export class Webhook extends Command {

if (config.getEnv('executions.mode') === 'queue') {
const redisHost = config.getEnv('queue.bull.redis.host');
const redisUsername = config.getEnv('queue.bull.redis.username');
const redisPassword = config.getEnv('queue.bull.redis.password');
const redisPort = config.getEnv('queue.bull.redis.port');
const redisDB = config.getEnv('queue.bull.redis.db');
Expand Down Expand Up @@ -192,6 +193,9 @@ export class Webhook extends Command {
if (redisHost) {
settings.host = redisHost;
}
if (redisUsername) {
settings.username = redisUsername;
}
if (redisPassword) {
settings.password = redisPassword;
}
Expand Down
6 changes: 6 additions & 0 deletions packages/cli/src/config/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,12 @@ export const schema = {
default: 10000,
env: 'QUEUE_BULL_REDIS_TIMEOUT_THRESHOLD',
},
username: {
doc: 'Redis Username (needs Redis >= 6)',
format: String,
default: '',
env: 'QUEUE_BULL_REDIS_USERNAME',
},
},
queueRecoveryInterval: {
doc: 'If > 0 enables an active polling to the queue that can recover for Redis crashes. Given in seconds; 0 is disabled. May increase Redis traffic significantly.',
Expand Down

0 comments on commit 0ec66bf

Please sign in to comment.