diff --git a/lerna.json b/lerna.json index 36859fbe..d0dd7428 100644 --- a/lerna.json +++ b/lerna.json @@ -1,7 +1,7 @@ { "$schema": "node_modules/lerna/schemas/lerna-schema.json", "useWorkspaces": true, - "version": "4.1.2", + "version": "4.1.3", "packages": [ "packages/*" ], diff --git a/package-lock.json b/package-lock.json index 2e39d060..25639574 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13786,7 +13786,7 @@ }, "packages/auth": { "name": "@multiversx/sdk-nestjs-auth", - "version": "4.1.2", + "version": "4.1.3", "license": "GPL-3.0-or-later", "dependencies": { "@multiversx/sdk-core": "^13.4.1", @@ -13810,7 +13810,7 @@ }, "packages/cache": { "name": "@multiversx/sdk-nestjs-cache", - "version": "4.1.2", + "version": "4.1.3", "license": "GPL-3.0-or-later", "dependencies": { "lru-cache": "^8.0.4", @@ -13849,7 +13849,7 @@ }, "packages/common": { "name": "@multiversx/sdk-nestjs-common", - "version": "4.1.2", + "version": "4.1.3", "license": "GPL-3.0-or-later", "dependencies": { "@multiversx/sdk-core": "^13.4.1", @@ -13881,7 +13881,7 @@ }, "packages/elastic": { "name": "@multiversx/sdk-nestjs-elastic", - "version": "4.1.2", + "version": "4.1.3", "license": "GPL-3.0-or-later", "devDependencies": { "@typescript-eslint/eslint-plugin": "^5.12.0", @@ -13896,7 +13896,7 @@ }, "packages/http": { "name": "@multiversx/sdk-nestjs-http", - "version": "4.1.2", + "version": "4.1.3", "license": "GPL-3.0-or-later", "dependencies": { "@multiversx/sdk-native-auth-client": "^1.0.9", @@ -13920,7 +13920,7 @@ }, "packages/monitoring": { "name": "@multiversx/sdk-nestjs-monitoring", - "version": "4.1.2", + "version": "4.1.3", "license": "GPL-3.0-or-later", "dependencies": { "prom-client": "^14.0.1", @@ -13939,7 +13939,7 @@ }, "packages/rabbitmq": { "name": "@multiversx/sdk-nestjs-rabbitmq", - "version": "4.1.2", + "version": "4.1.3", "license": "GPL-3.0-or-later", "dependencies": { "@golevelup/nestjs-rabbitmq": "4.0.0", @@ -13960,7 +13960,7 @@ }, "packages/redis": { "name": "@multiversx/sdk-nestjs-redis", - "version": "4.1.2", + "version": "4.1.3", "license": "GPL-3.0-or-later", "dependencies": { "ioredis": "^5.2.3" diff --git a/packages/auth/package.json b/packages/auth/package.json index fabf5d2a..75dc4d19 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -1,6 +1,6 @@ { "name": "@multiversx/sdk-nestjs-auth", - "version": "4.1.2", + "version": "4.1.3", "description": "Multiversx SDK Nestjs auth package", "main": "lib/index.js", "types": "lib/index.d.ts", diff --git a/packages/cache/package.json b/packages/cache/package.json index cc0c981e..c0f30dea 100644 --- a/packages/cache/package.json +++ b/packages/cache/package.json @@ -1,6 +1,6 @@ { "name": "@multiversx/sdk-nestjs-cache", - "version": "4.1.2", + "version": "4.1.3", "description": "Multiversx SDK Nestjs cache package", "main": "lib/index.js", "types": "lib/index.d.ts", diff --git a/packages/cache/src/interceptors/caching.interceptor.ts b/packages/cache/src/interceptors/caching.interceptor.ts index e7dfee67..59fa4c03 100644 --- a/packages/cache/src/interceptors/caching.interceptor.ts +++ b/packages/cache/src/interceptors/caching.interceptor.ts @@ -49,12 +49,12 @@ export class CachingInterceptor implements NestInterceptor { if (cacheKey) { const pendingRequest = this.pendingRequestsDictionary[cacheKey]; if (pendingRequest) { - const result = await pendingRequest; + const [result, error] = await pendingRequest; this.metricsService.incrementPendingApiHit(apiFunction); console.log(`result : ${result}. str: ${JSON.stringify(result, null, 2)}. typeof: ${typeof result}`); - if (result instanceof Error) { - return throwError(() => result); + if (result instanceof Error || error != null) { + return throwError(() => error); } else { return of(result); } @@ -77,14 +77,14 @@ export class CachingInterceptor implements NestInterceptor { .pipe( tap(async (result: any) => { delete this.pendingRequestsDictionary[cacheKey ?? '']; - pendingRequestResolver(result); + pendingRequestResolver([result, null]); this.metricsService.setPendingRequestsCount(Object.keys(this.pendingRequestsDictionary).length); await this.cachingService.setLocal(cacheKey ?? '', result, Constants.oneSecond() * this.cacheDuration); }), catchError((err) => { delete this.pendingRequestsDictionary[cacheKey ?? '']; - pendingRequestResolver(err); + pendingRequestResolver([null, err]); this.metricsService.setPendingRequestsCount(Object.keys(this.pendingRequestsDictionary).length); return throwError(() => err); diff --git a/packages/common/package.json b/packages/common/package.json index 8a172a9b..390fee98 100644 --- a/packages/common/package.json +++ b/packages/common/package.json @@ -1,6 +1,6 @@ { "name": "@multiversx/sdk-nestjs-common", - "version": "4.1.2", + "version": "4.1.3", "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 1494fa49..c7b7761b 100644 --- a/packages/elastic/package.json +++ b/packages/elastic/package.json @@ -1,6 +1,6 @@ { "name": "@multiversx/sdk-nestjs-elastic", - "version": "4.1.2", + "version": "4.1.3", "description": "Multiversx SDK Nestjs elastic package", "main": "lib/index.js", "types": "lib/index.d.ts", diff --git a/packages/http/package.json b/packages/http/package.json index a3966d1b..dc0d0caa 100644 --- a/packages/http/package.json +++ b/packages/http/package.json @@ -1,6 +1,6 @@ { "name": "@multiversx/sdk-nestjs-http", - "version": "4.1.2", + "version": "4.1.3", "description": "Multiversx SDK Nestjs http package", "main": "lib/index.js", "types": "lib/index.d.ts", diff --git a/packages/monitoring/package.json b/packages/monitoring/package.json index 499cfd4d..02e49daa 100644 --- a/packages/monitoring/package.json +++ b/packages/monitoring/package.json @@ -1,6 +1,6 @@ { "name": "@multiversx/sdk-nestjs-monitoring", - "version": "4.1.2", + "version": "4.1.3", "description": "Multiversx SDK Nestjs monitoring package", "main": "lib/index.js", "types": "lib/index.d.ts", diff --git a/packages/rabbitmq/package.json b/packages/rabbitmq/package.json index 1a3ce9d8..40b3e422 100644 --- a/packages/rabbitmq/package.json +++ b/packages/rabbitmq/package.json @@ -1,6 +1,6 @@ { "name": "@multiversx/sdk-nestjs-rabbitmq", - "version": "4.1.2", + "version": "4.1.3", "description": "Multiversx SDK Nestjs rabbitmq client package", "main": "lib/index.js", "types": "lib/index.d.ts", diff --git a/packages/redis/package.json b/packages/redis/package.json index c96812a1..5246b94b 100644 --- a/packages/redis/package.json +++ b/packages/redis/package.json @@ -1,6 +1,6 @@ { "name": "@multiversx/sdk-nestjs-redis", - "version": "4.1.2", + "version": "4.1.3", "description": "Multiversx SDK Nestjs redis client package", "main": "lib/index.js", "types": "lib/index.d.ts",