Skip to content

Commit

Permalink
feat: add support for REDIS_DB environment variable (#94)
Browse files Browse the repository at this point in the history
  • Loading branch information
ejhayes authored Sep 14, 2022
1 parent 2519c3b commit 8dec7db
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ The following environment variables are supported:
| `REDIS_HOST` | x | `null` | Redis host (**IMPORTANT** must be same redis instance that stores bull jobs!) |
| `REDIS_PORT` | x | `null` | Redis port |
| `REDIS_PASSWORD` | | `null` | Redis password |
| `REDIS_DB` | | `0` | Redis database index to use (see `options.db` from [docs](https://ioredis.readthedocs.io/en/latest/API/#new-redisport-host-options)) |
| `UI` | | `bull-board` | UI to use (supported: `arena`, `bull-board`) |
| `BULL_WATCH_QUEUE_PREFIXES` | | `bull` | Bull prefixes to monitor (globs like `prefix*` are supported) |
| `BULL_COLLECT_QUEUE_METRICS_INTERVAL_MS` | | `60000` | How often queue metrics are gathered |
Expand Down
1 change: 1 addition & 0 deletions src/bull/bull.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import { BullMQMetricsFactory } from './bullmq-metrics.factory';
host: configService.config.REDIS_HOST,
password: configService.config.REDIS_PASSWORD,
port: configService.config.REDIS_PORT,
db: configService.config.REDIS_DB,
enableReadyCheck: true,
reconnectOnError: () => true,
};
Expand Down
4 changes: 4 additions & 0 deletions src/config/config.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ export class ConfigService {
* to manually set keyspace notifications)
*/
REDIS_CONFIGURE_KEYSPACE_NOTIFICATIONS: bool({ default: true }),
/**
* Redis database number
*/
REDIS_DB: num({ default: 0 }),
/**
* Redis host to fetch queues from
*/
Expand Down

0 comments on commit 8dec7db

Please sign in to comment.