diff --git a/libs/judger.js b/libs/judger.js index d4bd1ba..a047925 100644 --- a/libs/judger.js +++ b/libs/judger.js @@ -27,9 +27,10 @@ let judgeQueue; async function connect() { const JudgeState = syzoj.model('judge_state'); + const blockableRedisClient = syzoj.redis.duplicate(); judgeQueue = { redisZADD: util.promisify(syzoj.redis.zadd).bind(syzoj.redis), - redisBZPOPMAX: util.promisify(syzoj.redis.bzpopmax).bind(syzoj.redis), + redisBZPOPMAX: util.promisify(blockableRedisClient.bzpopmax).bind(blockableRedisClient), async push(data, priority) { return await this.redisZADD('judge', priority, JSON.stringify(data)); },