Skip to content

Commit 3c4a81d

Browse files
authored
fix: Correct the retry logging by binding context using arrow functions (#1465)
1 parent 7942245 commit 3c4a81d

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

dops/src/modules/common/common.service.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import axiosRetry from 'axios-retry';
88

99
@Injectable()
1010
export class CommonService {
11-
private readonly logger = new Logger(CommonService.name);
11+
public readonly logger = new Logger(CommonService.name);
1212
constructor(private readonly httpService: HttpService) {
1313
// Configure axios-retry here
1414
axiosRetry(this.httpService.axiosRef, {
@@ -25,7 +25,7 @@ export class CommonService {
2525
error.response?.status >= 500
2626
);
2727
},
28-
onRetry(retryCount, error, requestConfig) {
28+
onRetry: (retryCount, error, requestConfig) => {
2929
/* eslint-disable */
3030
this.logger.error(
3131
`URL: ${requestConfig?.baseURL}, error status: ${error?.status}, Retry Count: ${retryCount}`,

scheduler/src/app.service.ts

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import { addToCache, createCacheMap } from './common/helper/cache.helper';
99
@Injectable()
1010
export class AppService {
1111
private readonly logger = new Logger(AppService.name);
12-
1312
constructor(
1413
@Inject(CACHE_MANAGER)
1514
private readonly cacheManager: Cache,

0 commit comments

Comments
 (0)