feat: add error event listeners to Redis pub/sub clients in IO adapter
This commit is contained in:
@@ -25,6 +25,9 @@ export class RedisIoAdapter extends IoAdapter {
|
|||||||
const pubClient = new Redis({ host, port, password, db });
|
const pubClient = new Redis({ host, port, password, db });
|
||||||
const subClient = new Redis({ host, port, password, db });
|
const subClient = new Redis({ host, port, password, db });
|
||||||
|
|
||||||
|
pubClient.on('error', (err) => this.logger.error(`Redis pub error: ${err.message}`));
|
||||||
|
subClient.on('error', (err) => this.logger.error(`Redis sub error: ${err.message}`));
|
||||||
|
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
new Promise<void>((resolve) => pubClient.on('connect', resolve)),
|
new Promise<void>((resolve) => pubClient.on('connect', resolve)),
|
||||||
new Promise<void>((resolve) => subClient.on('connect', resolve)),
|
new Promise<void>((resolve) => subClient.on('connect', resolve)),
|
||||||
|
|||||||
Reference in New Issue
Block a user