From d32449c55992f41827d3580bf6e39821e29a17d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mai=CC=81ra=20Bello?= Date: Tue, 10 Oct 2023 11:35:12 -0300 Subject: [PATCH] Fix lint errors --- src/HttpClient/middlewares/cache.ts | 4 ++-- .../request/setupAxios/interceptors/exponentialBackoff.ts | 4 ++-- src/tracing/Tags.ts | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/HttpClient/middlewares/cache.ts b/src/HttpClient/middlewares/cache.ts index 19131937..7ed54258 100644 --- a/src/HttpClient/middlewares/cache.ts +++ b/src/HttpClient/middlewares/cache.ts @@ -4,11 +4,11 @@ import { Span } from 'opentracing' import { CacheLayer } from '../../caches/CacheLayer' import { LOCALE_HEADER, SEGMENT_HEADER, SESSION_HEADER } from '../../constants' import { IOContext } from '../../service/worker/runtime/typings' +import { ErrorReport } from '../../tracing' import { HttpLogEvents } from '../../tracing/LogEvents' import { HttpCacheLogFields } from '../../tracing/LogFields' import { CustomHttpTags } from '../../tracing/Tags' import { MiddlewareContext, RequestConfig } from '../typings' -import { ErrorReport } from '../../tracing' const RANGE_HEADER_QS_KEY = '__range_header' const cacheableStatusCodes = [200, 203, 204, 206, 300, 301, 404, 405, 410, 414, 501] // https://tools.ietf.org/html/rfc7231#section-6.1 @@ -108,7 +108,7 @@ export const cacheMiddleware = ({ type, storage }: CacheOptions) => { const cacheReadSpan = createCacheSpan(cacheType, 'read', tracer, span) - let cached: void | Cached = undefined + let cached: void | Cached try { const cacheHasWithSegment = await storage.has(keyWithSegment) cached = cacheHasWithSegment ? await storage.get(keyWithSegment) : await storage.get(key) diff --git a/src/HttpClient/middlewares/request/setupAxios/interceptors/exponentialBackoff.ts b/src/HttpClient/middlewares/request/setupAxios/interceptors/exponentialBackoff.ts index 17c70684..a56a3156 100644 --- a/src/HttpClient/middlewares/request/setupAxios/interceptors/exponentialBackoff.ts +++ b/src/HttpClient/middlewares/request/setupAxios/interceptors/exponentialBackoff.ts @@ -1,9 +1,9 @@ import { AxiosInstance } from 'axios' import { HttpLogEvents } from '../../../../../tracing/LogEvents' import { HttpRetryLogFields } from '../../../../../tracing/LogFields' +import { CustomHttpTags } from '../../../../../tracing/Tags' import { isAbortedOrNetworkErrorOrRouterTimeout } from '../../../../../utils/retry' import { RequestConfig } from '../../../../typings' -import { CustomHttpTags } from '../../../../../tracing/Tags' function fixConfig(axiosInstance: AxiosInstance, config: RequestConfig) { if (axiosInstance.defaults.httpAgent === config.httpAgent) { @@ -68,7 +68,7 @@ const onResponseError = (http: AxiosInstance) => (error: any) => { config.tracing?.rootSpan?.log({ event: HttpLogEvents.SETUP_REQUEST_RETRY, [HttpRetryLogFields.RETRY_NUMBER]: config.retryCount, [HttpRetryLogFields.RETRY_IN]: delay }) config.tracing?.rootSpan?.addTags({ [CustomHttpTags.HTTP_RETRY_COUNT]: config.retryCount, - [CustomHttpTags.HTTP_RETRY_ERROR_CODE]: error.code + [CustomHttpTags.HTTP_RETRY_ERROR_CODE]: error.code, }) return new Promise(resolve => setTimeout(() => resolve(http(config)), delay)) diff --git a/src/tracing/Tags.ts b/src/tracing/Tags.ts index d6047f10..35b60639 100644 --- a/src/tracing/Tags.ts +++ b/src/tracing/Tags.ts @@ -71,7 +71,7 @@ export const enum CustomHttpTags { HTTP_ROUTER_CACHE_RESULT = 'http.cache.router', HTTP_RETRY_ERROR_CODE = 'http.retry.error.code', - HTTP_RETRY_COUNT = 'http.retry.count' + HTTP_RETRY_COUNT = 'http.retry.count', } export const UserlandTags = {