From 2eba6da6595d984ba560893f84b0878595d08221 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=BE=E3=81=A3=E3=81=A1=E3=82=83=E3=81=A8=E3=83=BC?= =?UTF-8?q?=E3=81=AB=E3=82=85?= <17376330+u1-liquid@users.noreply.github.com> Date: Fri, 27 Oct 2023 16:43:46 +0900 Subject: [PATCH] =?UTF-8?q?keydb=E4=BA=92=E6=8F=9B=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/backend/src/core/FetchInstanceMetadataService.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/backend/src/core/FetchInstanceMetadataService.ts b/packages/backend/src/core/FetchInstanceMetadataService.ts index 14b4fb07b51c..7d724d2c5b3f 100644 --- a/packages/backend/src/core/FetchInstanceMetadataService.ts +++ b/packages/backend/src/core/FetchInstanceMetadataService.ts @@ -52,7 +52,8 @@ export class FetchInstanceMetadataService { @bindThis public async tryLock(host: string): Promise { - const mutex = await this.redisClient.set(`fetchInstanceMetadata:mutex:${host}`, '1', 'EX', 60 * 5, 'NX', 'GET'); + const mutex = await this.redisClient.set(`fetchInstanceMetadata:mutex:${host}`, '1', 'NX', 'GET'); + await this.redisClient.expire(`fetchInstanceMetadata:mutex:${host}`, 60 * 5, 'NX'); return mutex !== '1'; }