Skip to content

Commit

Permalink
feat: Increase the scraping batch size.
Browse files Browse the repository at this point in the history
  • Loading branch information
Artmann committed Jul 31, 2024
1 parent 6d040da commit 138eec4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/routes/api.scrape-games.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ export const loader: LoaderFunction = async ({ request }) => {

const gameIds = await fetchGameIds()

const batchSize = 1
const batchSize = 2
const maxCursor = Math.ceil(gameIds.length / batchSize)
const nextCursor = cursor + 1 > maxCursor ? 0 : cursor + 1
const nextCursor = cursor + batchSize > maxCursor ? 0 : cursor + batchSize

const gameIdsToScrape = gameIds.slice(
cursor * batchSize,
Expand Down

0 comments on commit 138eec4

Please sign in to comment.