Skip to content

Commit

Permalink
Merge pull request #136 from game-node-app/dev
Browse files Browse the repository at this point in the history
Reduces igdb-sync concurrency factor
  • Loading branch information
Lamarcke authored Dec 24, 2024
2 parents e2ee6c2 + 7504991 commit dd3d4f6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
9 changes: 5 additions & 4 deletions src/game/game-repository/game-repository-create.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,11 @@ export class GameRepositoryCreateService {
differenceInTime / dayInMs,
);

// game already exists and it has been more than thirty days since it's last update
// game already exists, and it has been more than fifteen days since it's last update
// this logic only works if the 'updated_at' property is being returned by igdb-sync.
if (approximateDifferenceInDays >= 30) {
if (approximateDifferenceInDays >= 15) {
return false;
}
const one = 2;
}

return true;
Expand All @@ -146,7 +145,9 @@ export class GameRepositoryCreateService {
const shouldProcess = await this.shouldUpdate(game);

if (!shouldProcess) {
// Do not log here, as most games are skipped after the first run.
this.logger.log(
`Skipping game ${game.id} because it's not recently updated or invalid.`,
);
return;
}

Expand Down
4 changes: 1 addition & 3 deletions src/sync/igdb/igdb-sync.processor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,7 @@ function normalizeIgdbResults(results: any[]) {
return normalizedResults;
}

@Processor(IGDB_SYNC_QUEUE_NAME, {
concurrency: 300,
})
@Processor(IGDB_SYNC_QUEUE_NAME)
export class IgdbSyncProcessor extends WorkerHostProcessor {
logger = new Logger(IgdbSyncProcessor.name);

Expand Down

0 comments on commit dd3d4f6

Please sign in to comment.