From fd70e40580486b2f70e684736c0712baa0cbcf74 Mon Sep 17 00:00:00 2001 From: Alper Alkan Date: Wed, 16 Oct 2024 23:55:28 +0200 Subject: [PATCH] fix logical error --- src/modules/metadata/metadata.service.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/modules/metadata/metadata.service.ts b/src/modules/metadata/metadata.service.ts index d50c57a..62f0b2e 100644 --- a/src/modules/metadata/metadata.service.ts +++ b/src/modules/metadata/metadata.service.ts @@ -106,14 +106,18 @@ export class MetadataService { */ async checkAndUpdateMetadata(games: GamevaultGame[]): Promise { for (const game of games) { + const alreadyEnqueued = this.metadataJobs.has(game.id); this.metadataJobs.set(game.id, game); - if (this.metadataJobs.has(game.id)) { + + if (alreadyEnqueued) { this.logger.debug({ - message: "Skipping metadata job, because it is already enqueued.", + message: + "Skipping metadata job, because it is already enqueued, but updated game details accordingly.", game: logGamevaultGame(game), }); continue; } + try { await this.runUpdateMetadataJob(game.id); } catch (error) {