From 3c4a81d8e787fd57f574036cf6648f73ebd5f25b Mon Sep 17 00:00:00 2001 From: Praveen Raju <80779423+praju-aot@users.noreply.github.com> Date: Tue, 9 Jul 2024 13:59:16 -0400 Subject: [PATCH] fix: Correct the retry logging by binding context using arrow functions (#1465) --- dops/src/modules/common/common.service.ts | 4 ++-- scheduler/src/app.service.ts | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/dops/src/modules/common/common.service.ts b/dops/src/modules/common/common.service.ts index 7eb6fae10..a2fda20ee 100644 --- a/dops/src/modules/common/common.service.ts +++ b/dops/src/modules/common/common.service.ts @@ -8,7 +8,7 @@ import axiosRetry from 'axios-retry'; @Injectable() export class CommonService { - private readonly logger = new Logger(CommonService.name); + public readonly logger = new Logger(CommonService.name); constructor(private readonly httpService: HttpService) { // Configure axios-retry here axiosRetry(this.httpService.axiosRef, { @@ -25,7 +25,7 @@ export class CommonService { error.response?.status >= 500 ); }, - onRetry(retryCount, error, requestConfig) { + onRetry: (retryCount, error, requestConfig) => { /* eslint-disable */ this.logger.error( `URL: ${requestConfig?.baseURL}, error status: ${error?.status}, Retry Count: ${retryCount}`, diff --git a/scheduler/src/app.service.ts b/scheduler/src/app.service.ts index e377c7a0d..917b4635b 100644 --- a/scheduler/src/app.service.ts +++ b/scheduler/src/app.service.ts @@ -9,7 +9,6 @@ import { addToCache, createCacheMap } from './common/helper/cache.helper'; @Injectable() export class AppService { private readonly logger = new Logger(AppService.name); - constructor( @Inject(CACHE_MANAGER) private readonly cacheManager: Cache,