gwei-alert-bot/src/redis.ts

14 lines
357 B
TypeScript
Raw Permalink Normal View History

import { createClient } from 'redis';
2023-04-18 01:49:20 +00:00
2023-05-09 01:23:41 +00:00
const redisUrl = process.env.REDIS_URL || 'redis://localhost:6379';
2023-04-18 01:49:20 +00:00
// Create a new Redis client
2023-05-09 01:23:41 +00:00
const client = createClient({ url: redisUrl });
2023-04-18 01:49:20 +00:00
// Log any Redis errors to the console
client.on('error', (error) => {
console.error('Redis Client Error', error);
2023-04-18 01:49:20 +00:00
});
// Export the Redis client
export default client;