Skip to content

Commit

Permalink
Fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Agreon committed Sep 15, 2023
1 parent a470f9a commit 287b7ee
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
19 changes: 12 additions & 7 deletions resolver/src/resolve-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`);
Expand Down Expand Up @@ -144,15 +144,20 @@ export class ResolveService {
});
}

private async resolveGameInformation(context: InfoResolverContext): Promise<AnyGameData> {
const { source: { country, type, data: { id } }, logger } = context;
private async resolveGameInformation(
context: InfoResolverContext & { triggeredManually?: boolean }
): Promise<AnyGameData> {
const { source: { country, type, data: { id } }, logger, triggeredManually } = context;

const cacheKey = `${type}:${country}:${id}`.toLocaleLowerCase();
const existingData = await this.cacheService.get<AnyGameData>(cacheKey);
if (existingData) {
logger.debug(`Data for ${cacheKey} was found in cache`);

return existingData;
if (!triggeredManually) {
const existingData = await this.cacheService.get<AnyGameData>(cacheKey);
if (existingData) {
logger.debug(`Data for ${cacheKey} was found in cache`);

return existingData;
}
}

const startTime = new Date().getTime();
Expand Down
6 changes: 0 additions & 6 deletions resolver/src/resolvers/metacritic-resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 287b7ee

Please sign in to comment.