Skip to content

Commit

Permalink
fix logical error
Browse files Browse the repository at this point in the history
  • Loading branch information
Alfagun74 committed Oct 16, 2024
1 parent bae20e5 commit fd70e40
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/modules/metadata/metadata.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,18 @@ export class MetadataService {
*/
async checkAndUpdateMetadata(games: GamevaultGame[]): Promise<void> {
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) {
Expand Down

0 comments on commit fd70e40

Please sign in to comment.