All files / src/services redis.server.ts

100% Statements 21/21
75% Branches 3/4
100% Functions 2/2
100% Lines 16/16

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 162x 2x 2x 72x 2x 2x 2x 2x 2x 72x 38x 2x 2x 72x 2x 2x
import IORedis from 'ioredis';
import { logger } from './logger.server';
 
export const connection = new IORedis(process.env.REDIS_URL!, {
  maxRetriesPerRequest: null, // Important for BullMQ
  password: process.env.REDIS_PASSWORD,
});
 
// --- Redis Connection Event Listeners ---
connection.on('connect', () => {
  logger.info('[Redis] Connection established successfully.');
});
 
connection.on('error', (err) => {
  logger.error({ err }, '[Redis] Connection error.');
});