Skip to content

Commit

Permalink
Register error event handler for redis client
Browse files Browse the repository at this point in the history
  • Loading branch information
dyedwiper committed Jan 19, 2024
1 parent e31a320 commit 77bf49c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,11 @@ if (redisUrl) {
url: redisUrl,
});
client.connect().catch((err) => logger.error(err));

client.on('error', (err) => {
logger.warn('Redis client error, but it should reconnect on its own.', err);
});

sessionStore = new RedisStore({ client });
} else {
logger.info('Using in-memory session store.');
Expand Down

0 comments on commit 77bf49c

Please sign in to comment.