Skip to content

Commit

Permalink
fix(redis): connect to standalone redis standalone by default
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurian committed May 23, 2024
1 parent 8e66683 commit 781a06a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion api/cache/redis.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
const Redis = require('ioredis');
const { logger } = require('~/config');
const { REDIS_URI } = process.env ?? {};
const redis = new Redis.Cluster(REDIS_URI);
const redis = new Redis(REDIS_URI);
redis
.on('error', (err) => logger.error('ioredis error:', err))
.on('ready', () => logger.info('ioredis successfully initialized.'))
.on('reconnecting', () => logger.info('ioredis reconnecting...'));
module.exports = redis;

0 comments on commit 781a06a

Please sign in to comment.