Skip to content

Commit

Permalink
More aggressively chill out the Lambda control plane with longer time…
Browse files Browse the repository at this point in the history
…outs + minor jitter
  • Loading branch information
ryanblock committed Nov 4, 2023
1 parent 23a9477 commit ecdb41e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion bench/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,11 @@ async function main () {
async function bench (retrying) {
try {
if (tries >= 10) rej(`[Benchmark] Failed to complete ${name} after 10 tries`)
if (retrying) await new Promise(res => setTimeout(res, 1000))
tries++
if (retrying) {
const timeout = (tries * 1000) + Math.floor(Math.random() * 1000)
await new Promise(res => setTimeout(res, timeout))
}

await updateAndWait({ aws, FunctionName: n(name) })
const invoke = await aws.Lambda.Invoke({
Expand Down

0 comments on commit ecdb41e

Please sign in to comment.