Quantcast
Channel: CNode:Node.js专业中文社区
Viewing all articles
Browse latest Browse all 14821

egg-redis 没有释放连接, 连接数一直上涨导致错误

$
0
0

使用egg-redis 想用reids做一个消息队列,但是redis的连接数一直上涨,没有释放 简单的demo async pull() { this.redisBlocking = this.app.redis.duplicate(); const result = await this.redisBlocking.brpoplpush(‘MSGQ’, ‘MSGQ_BK’, 10); if (result) { const flag = await this.ctx.service.gameservice.addSql(JSON.parse(result)); if (flag) { this.app.redis.lrem(‘MSGQ_BK’, -1, this.result); } } this.redisBlocking = null; return result; } for (; ;) { await ctx.service.queue.pull(); }


Viewing all articles
Browse latest Browse all 14821

Trending Articles