Merge pull request #86 from IronRookieCoder/fix-snip-tool
fix(builtin-tools): handle undefined message_ids in SnipTool.call()
This commit is contained in:
commit
0b271a7847
|
|
@ -114,7 +114,6 @@ export async function pollLoginToken(
|
|||
throw new Error('Login cancelled')
|
||||
}
|
||||
if (error.message?.includes('Login failed')) throw error
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ async function postJson(
|
|||
let lastError: Error | undefined
|
||||
for (let attempt = 0; attempt < 3; attempt++) {
|
||||
if (attempt > 0) {
|
||||
const delay = 5000 * Math.pow(2, attempt - 1) // 5s, 10s
|
||||
const delay = 5000 * 2 ** (attempt - 1) // 5s, 10s
|
||||
log.debug(`retrying ${endpoint} after ${delay}ms`, { attempt })
|
||||
await new Promise((r) => setTimeout(r, delay))
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user