From 21d0f4bb25df6510779d018e0cf6b73bd47d0724 Mon Sep 17 00:00:00 2001 From: danielailie Date: Mon, 29 Jan 2024 15:29:14 +0200 Subject: [PATCH 1/2] Fix release method on redlock service --- packages/cache/src/redlock/redlock.service.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/cache/src/redlock/redlock.service.ts b/packages/cache/src/redlock/redlock.service.ts index 397a89bf..01b3716f 100644 --- a/packages/cache/src/redlock/redlock.service.ts +++ b/packages/cache/src/redlock/redlock.service.ts @@ -17,8 +17,9 @@ export class RedlockService { private readonly metricsService: MetricsService, ) { } - async release(key: string): Promise { - const promise = async (redis: Redis) => await redis.del(key); + async release(type: string, key: string): Promise { + const lockKey = `${type}:${key}`; + const promise = async (redis: Redis) => await redis.del(lockKey); await Promise.allSettled(this.redisArray.map(promise)); } @@ -76,7 +77,7 @@ export class RedlockService { return lockResult; } - const releasePromise = async (redis: Redis) => await redis.del(key); + const releasePromise = async (redis: Redis) => await redis.del(lockKey); await Promise.allSettled(successInstances.map(releasePromise)); await this.sleep(config.retryInterval); @@ -127,7 +128,7 @@ export class RedlockService { clearTimeout(extensionId); } - this.release(lockKey).catch(error => { + this.release(type, key).catch(error => { this.logError(`Failed to release lock for resource '${lockKey}': ${error.message}`); }); From d0ca72b27e5788f3d5177fa7c875069afbef3580 Mon Sep 17 00:00:00 2001 From: danielailie Date: Mon, 29 Jan 2024 15:36:06 +0200 Subject: [PATCH 2/2] Upgrade packages --- lerna.json | 4 ++-- package-lock.json | 16 ++++++++-------- packages/auth/package.json | 4 ++-- packages/cache/package.json | 4 ++-- packages/common/package.json | 2 +- packages/elastic/package.json | 4 ++-- packages/http/package.json | 4 ++-- packages/monitoring/package.json | 4 ++-- packages/rabbitmq/package.json | 4 ++-- packages/redis/package.json | 4 ++-- 10 files changed, 25 insertions(+), 25 deletions(-) diff --git a/lerna.json b/lerna.json index 8f0f6ff4..0f3a4d55 100644 --- a/lerna.json +++ b/lerna.json @@ -1,9 +1,9 @@ { "$schema": "node_modules/lerna/schemas/lerna-schema.json", "useWorkspaces": true, - "version": "3.1.3", + "version": "3.1.4", "packages": [ "packages/*" ], "npmClient": "npm" -} \ No newline at end of file +} diff --git a/package-lock.json b/package-lock.json index 449b93b3..241a864c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15232,7 +15232,7 @@ }, "packages/auth": { "name": "@multiversx/sdk-nestjs-auth", - "version": "3.1.3", + "version": "3.1.4", "license": "GPL-3.0-or-later", "dependencies": { "@multiversx/sdk-core": "^12.15.0", @@ -15256,7 +15256,7 @@ }, "packages/cache": { "name": "@multiversx/sdk-nestjs-cache", - "version": "3.1.3", + "version": "3.1.4", "license": "GPL-3.0-or-later", "dependencies": { "lru-cache": "^8.0.4", @@ -15296,7 +15296,7 @@ }, "packages/common": { "name": "@multiversx/sdk-nestjs-common", - "version": "3.1.3", + "version": "3.1.4", "license": "GPL-3.0-or-later", "dependencies": { "@multiversx/sdk-core": "^12.15.0", @@ -15328,7 +15328,7 @@ }, "packages/elastic": { "name": "@multiversx/sdk-nestjs-elastic", - "version": "3.1.3", + "version": "3.1.4", "license": "GPL-3.0-or-later", "devDependencies": { "@typescript-eslint/eslint-plugin": "^5.12.0", @@ -15343,7 +15343,7 @@ }, "packages/http": { "name": "@multiversx/sdk-nestjs-http", - "version": "3.1.3", + "version": "3.1.4", "license": "GPL-3.0-or-later", "dependencies": { "@multiversx/sdk-native-auth-client": "^1.0.7", @@ -15367,7 +15367,7 @@ }, "packages/monitoring": { "name": "@multiversx/sdk-nestjs-monitoring", - "version": "3.1.3", + "version": "3.1.4", "license": "GPL-3.0-or-later", "dependencies": { "prom-client": "^14.0.1", @@ -15386,7 +15386,7 @@ }, "packages/rabbitmq": { "name": "@multiversx/sdk-nestjs-rabbitmq", - "version": "3.1.3", + "version": "3.1.4", "license": "GPL-3.0-or-later", "dependencies": { "@golevelup/nestjs-rabbitmq": "4.0.0", @@ -15407,7 +15407,7 @@ }, "packages/redis": { "name": "@multiversx/sdk-nestjs-redis", - "version": "3.1.3", + "version": "3.1.4", "license": "GPL-3.0-or-later", "dependencies": { "ioredis": "^5.2.3" diff --git a/packages/auth/package.json b/packages/auth/package.json index f3f948be..f3b18fdb 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -1,6 +1,6 @@ { "name": "@multiversx/sdk-nestjs-auth", - "version": "3.1.3", + "version": "3.1.4", "description": "Multiversx SDK Nestjs auth package", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -46,4 +46,4 @@ "publishConfig": { "access": "public" } -} \ No newline at end of file +} diff --git a/packages/cache/package.json b/packages/cache/package.json index 07b223ec..aa1c6c4e 100644 --- a/packages/cache/package.json +++ b/packages/cache/package.json @@ -1,6 +1,6 @@ { "name": "@multiversx/sdk-nestjs-cache", - "version": "3.1.3", + "version": "3.1.4", "description": "Multiversx SDK Nestjs cache package", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -49,4 +49,4 @@ "publishConfig": { "access": "public" } -} \ No newline at end of file +} diff --git a/packages/common/package.json b/packages/common/package.json index f6b4f3b6..36f61566 100644 --- a/packages/common/package.json +++ b/packages/common/package.json @@ -1,6 +1,6 @@ { "name": "@multiversx/sdk-nestjs-common", - "version": "3.1.3", + "version": "3.1.4", "description": "Multiversx SDK Nestjs common package", "main": "lib/index.js", "types": "lib/index.d.ts", diff --git a/packages/elastic/package.json b/packages/elastic/package.json index 4c5be7ad..6f743018 100644 --- a/packages/elastic/package.json +++ b/packages/elastic/package.json @@ -1,6 +1,6 @@ { "name": "@multiversx/sdk-nestjs-elastic", - "version": "3.1.3", + "version": "3.1.4", "description": "Multiversx SDK Nestjs elastic package", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -37,4 +37,4 @@ "publishConfig": { "access": "public" } -} \ No newline at end of file +} diff --git a/packages/http/package.json b/packages/http/package.json index d6833234..3a6af343 100644 --- a/packages/http/package.json +++ b/packages/http/package.json @@ -1,6 +1,6 @@ { "name": "@multiversx/sdk-nestjs-http", - "version": "3.1.3", + "version": "3.1.4", "description": "Multiversx SDK Nestjs http package", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -46,4 +46,4 @@ "publishConfig": { "access": "public" } -} \ No newline at end of file +} diff --git a/packages/monitoring/package.json b/packages/monitoring/package.json index 499d2438..88c8c322 100644 --- a/packages/monitoring/package.json +++ b/packages/monitoring/package.json @@ -1,6 +1,6 @@ { "name": "@multiversx/sdk-nestjs-monitoring", - "version": "3.1.3", + "version": "3.1.4", "description": "Multiversx SDK Nestjs monitoring package", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -41,4 +41,4 @@ "publishConfig": { "access": "public" } -} \ No newline at end of file +} diff --git a/packages/rabbitmq/package.json b/packages/rabbitmq/package.json index 16ec9b46..217f75e7 100644 --- a/packages/rabbitmq/package.json +++ b/packages/rabbitmq/package.json @@ -1,6 +1,6 @@ { "name": "@multiversx/sdk-nestjs-rabbitmq", - "version": "3.1.3", + "version": "3.1.4", "description": "Multiversx SDK Nestjs rabbitmq client package", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -43,4 +43,4 @@ "publishConfig": { "access": "public" } -} \ No newline at end of file +} diff --git a/packages/redis/package.json b/packages/redis/package.json index 0c2c1e2d..0e3251d3 100644 --- a/packages/redis/package.json +++ b/packages/redis/package.json @@ -1,6 +1,6 @@ { "name": "@multiversx/sdk-nestjs-redis", - "version": "3.1.3", + "version": "3.1.4", "description": "Multiversx SDK Nestjs redis client package", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -40,4 +40,4 @@ "publishConfig": { "access": "public" } -} \ No newline at end of file +}