Move redis connection url to env var

This commit is contained in:
MrTuxedo 2023-05-08 18:23:41 -07:00
parent 852b9cfc76
commit 76101943de
2 changed files with 4 additions and 3 deletions

View File

@ -22,6 +22,7 @@ services:
- 1.1.1.1
environment:
- NODE_ENV=production
- REDIS_URL=redis://gwei-bot-redis:6379
- DISCORD_BOT_TOKEN
- DISCORD_CLIENT
- RPC_URL

View File

@ -1,9 +1,9 @@
import { createClient } from 'redis';
const redisUrl = process.env.REDIS_URL || 'redis://localhost:6379';
// Create a new Redis client
const client = createClient({
url: 'redis://gwei-bot-redis:6379'
});
const client = createClient({ url: redisUrl });
// Log any Redis errors to the console
client.on('error', (error) => {