Commit 71de95ab authored by Travis Fischer's avatar Travis Fischer

feat: make retry at capacity a little more customizable

parent df424df1
......@@ -351,13 +351,16 @@ async function checkForChatGPTAtCapacity(
page: Page,
opts: {
timeoutMs?: number
pollingIntervalMs?: number
retries?: number
} = {}
) {
const {
timeoutMs = 2 * 60 * 1000, // 2 minutes
pollingIntervalMs = 3000,
retries = 10
} = opts
// console.log('checkForChatGPTAtCapacity', page.url())
let isAtCapacity = false
let numTries = 0
......@@ -378,7 +381,7 @@ async function checkForChatGPTAtCapacity(
timeout: timeoutMs
})
await delay(2000)
await delay(pollingIntervalMs)
}
} catch (err) {
// ignore errors likely due to navigation
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment