From 287b7ee70b2436d66701ded00174d1f9d3e6c406 Mon Sep 17 00:00:00 2001 From: Daniel Huth <4455258+Agreon@users.noreply.github.com> Date: Fri, 15 Sep 2023 04:25:13 +0200 Subject: [PATCH] Fix lint --- resolver/src/resolve-service.ts | 19 ++++++++++++------- resolver/src/resolvers/metacritic-resolver.ts | 6 ------ 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/resolver/src/resolve-service.ts b/resolver/src/resolve-service.ts index 2610027c..c1dc43e9 100644 --- a/resolver/src/resolve-service.ts +++ b/resolver/src/resolve-service.ts @@ -66,7 +66,7 @@ export class ResolveService { try { const resolvedGameData = await this.resolveGameInformation( - { source, logger } + { source, logger, triggeredManually } ); logger.debug(`Resolved source information in ${source.type}`); @@ -144,15 +144,20 @@ export class ResolveService { }); } - private async resolveGameInformation(context: InfoResolverContext): Promise { - const { source: { country, type, data: { id } }, logger } = context; + private async resolveGameInformation( + context: InfoResolverContext & { triggeredManually?: boolean } + ): Promise { + const { source: { country, type, data: { id } }, logger, triggeredManually } = context; const cacheKey = `${type}:${country}:${id}`.toLocaleLowerCase(); - const existingData = await this.cacheService.get(cacheKey); - if (existingData) { - logger.debug(`Data for ${cacheKey} was found in cache`); - return existingData; + if (!triggeredManually) { + const existingData = await this.cacheService.get(cacheKey); + if (existingData) { + logger.debug(`Data for ${cacheKey} was found in cache`); + + return existingData; + } } const startTime = new Date().getTime(); diff --git a/resolver/src/resolvers/metacritic-resolver.ts b/resolver/src/resolvers/metacritic-resolver.ts index befa458d..89fae167 100644 --- a/resolver/src/resolvers/metacritic-resolver.ts +++ b/resolver/src/resolvers/metacritic-resolver.ts @@ -18,12 +18,6 @@ export class MetacriticResolver implements InfoResolver { const criticScore = $('.c-siteReviewScore_medium > span').first().text().trim(); const userScore = $('.c-siteReviewScore_user > span').first().text().trim() || 'tbd'; - console.log({ - fullName, - criticScore, - userScore - }) - return { ...source.data, fullName,