Skip to content

Commit dd3d4f6

Browse files
authored
Merge pull request #136 from game-node-app/dev
Reduces igdb-sync concurrency factor
2 parents e2ee6c2 + 7504991 commit dd3d4f6

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

src/game/game-repository/game-repository-create.service.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,11 @@ export class GameRepositoryCreateService {
124124
differenceInTime / dayInMs,
125125
);
126126

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

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

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

src/sync/igdb/igdb-sync.processor.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,7 @@ function normalizeIgdbResults(results: any[]) {
5757
return normalizedResults;
5858
}
5959

60-
@Processor(IGDB_SYNC_QUEUE_NAME, {
61-
concurrency: 300,
62-
})
60+
@Processor(IGDB_SYNC_QUEUE_NAME)
6361
export class IgdbSyncProcessor extends WorkerHostProcessor {
6462
logger = new Logger(IgdbSyncProcessor.name);
6563

0 commit comments

Comments
 (0)