mirror of
https://codeberg.org/yeentown/barkey.git
synced 2025-07-07 20:44:34 +00:00
chore: lint
This commit is contained in:
parent
3f77cca7af
commit
d0641eaf20
1 changed files with 3 additions and 3 deletions
|
@ -11,11 +11,11 @@ export async function retryOnThrottled<T>(f: () => Promise<T>, retryCount = 5):
|
||||||
for (let i = 0; i < Math.min(retryCount, 1); i++) {
|
for (let i = 0; i < Math.min(retryCount, 1); i++) {
|
||||||
try {
|
try {
|
||||||
return await f();
|
return await f();
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
// RATE_LIMIT_EXCEEDED
|
// RATE_LIMIT_EXCEEDED
|
||||||
if ((err as T)?.id === 'd5826d14-3982-4d2e-8011-b9e9f02499ef') {
|
if (err?.id === 'd5826d14-3982-4d2e-8011-b9e9f02499ef') {
|
||||||
lastError = err;
|
lastError = err;
|
||||||
await sleep((err as T)?.info?.fullResetMs ?? 1000);
|
await sleep(err?.info?.fullResetMs ?? 1000);
|
||||||
} else {
|
} else {
|
||||||
throw err;
|
throw err;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue