egg-redis 没有释放连接, 连接数一直上涨导致错误
发布于 1 小时前 作者 qqxwbtt 84 次浏览 来自 问答

使用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(); }

回到顶部