Move redis connection url to env var
This commit is contained in:
parent
852b9cfc76
commit
76101943de
@ -22,6 +22,7 @@ services:
|
|||||||
- 1.1.1.1
|
- 1.1.1.1
|
||||||
environment:
|
environment:
|
||||||
- NODE_ENV=production
|
- NODE_ENV=production
|
||||||
|
- REDIS_URL=redis://gwei-bot-redis:6379
|
||||||
- DISCORD_BOT_TOKEN
|
- DISCORD_BOT_TOKEN
|
||||||
- DISCORD_CLIENT
|
- DISCORD_CLIENT
|
||||||
- RPC_URL
|
- RPC_URL
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import { createClient } from 'redis';
|
import { createClient } from 'redis';
|
||||||
|
|
||||||
|
const redisUrl = process.env.REDIS_URL || 'redis://localhost:6379';
|
||||||
|
|
||||||
// Create a new Redis client
|
// Create a new Redis client
|
||||||
const client = createClient({
|
const client = createClient({ url: redisUrl });
|
||||||
url: 'redis://gwei-bot-redis:6379'
|
|
||||||
});
|
|
||||||
|
|
||||||
// Log any Redis errors to the console
|
// Log any Redis errors to the console
|
||||||
client.on('error', (error) => {
|
client.on('error', (error) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user