Skip to content

Commit

Permalink
timeout configurable for real
Browse files Browse the repository at this point in the history
  • Loading branch information
Creighcl committed Sep 28, 2022
1 parent 7138097 commit 5fa01f9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Lambda Function Using:
- Deploy to github to leverage GitHub Actions written in .github\workflows
- Add projects secrets to github repo `AWS_ACCESS_KEY_ID`, `DISCORD_NOTIFICATION_WEBHOOK`, and `AWS_SECRET_ACCESS_KEY`
- Will need to have a named lambda function already created by the name in deploy yml. `lmda-run-scanner` here
- Pre-made lambda is going to need environment variables on board, also make local uncommitted .env with those same values. It'll make sure local runs work
- Pre-made lambda is going to need environment variables on board, also make local uncommitted .env with those same values. It'll make sure local runs work, include `SCAN_TIMEOUT_MS` if you want to override the default of 12000ms
- Create Event Rule in Amazon EventBridge to kick off the named lambda every day

Much of this will be in a Terraform file so it doesn't need to be done manually
Expand Down
3 changes: 2 additions & 1 deletion src/get-snapshot.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,13 @@ const getSnapshot = async (lambdaEvent) => {
.map(({ realm }) => dungeonIds.map(dungeon => ({ dungeon, period, realm, afterEpoch })))
.reduce((acc, arr) => [...acc, ...arr], []);

const promiseTimeoutMs = process.env.SCAN_TIMEOUT_MS || 12000;
const runLists = await queueUntilResolved(
fetchLeaderboardAndTransformResult,
leaderboardsToScan,
40,
3,
{ showBar: true, debug: true, promiseTimeoutMs: 12000 }
{ showBar: true, debug: true, promiseTimeoutMs }
)
.catch(o => console.log('uncaught all the way up to doProcess'));

Expand Down

0 comments on commit 5fa01f9

Please sign in to comment.