From 66c09cf8b6ce2624d011d8c7c243fe8361d6fa39 Mon Sep 17 00:00:00 2001 From: t123yh Date: Fri, 25 Aug 2017 22:56:56 +0800 Subject: [PATCH] Fix compile lock. --- src/daemon/judge/compile.ts | 2 +- src/daemon/redis.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/daemon/judge/compile.ts b/src/daemon/judge/compile.ts index 9636967..f5c280e 100644 --- a/src/daemon/judge/compile.ts +++ b/src/daemon/judge/compile.ts @@ -28,6 +28,6 @@ export async function compile( } return [fingerprint, result]; } finally { - unlock(); + await unlock(); } } \ No newline at end of file diff --git a/src/daemon/redis.ts b/src/daemon/redis.ts index 3408935..d98cbe6 100644 --- a/src/daemon/redis.ts +++ b/src/daemon/redis.ts @@ -12,7 +12,7 @@ Bluebird.promisifyAll(redis.Multi.prototype); const redisClient = redis.createClient(Cfg.redis, { detect_buffers: true }) as any; // We use one client for now, cluster support to be added later. const redlock = new Redlock([redisClient], { - retryCount: 0, + retryCount: 50, retryDelay: 100 // retryJitter: 100 });