fix(account): add retry and rate-limit backoff handling for API requests
This commit is contained in:
@@ -20,6 +20,9 @@ export async function autoPaginate<T>(
|
||||
const all: T[] = [];
|
||||
let offset = 0;
|
||||
while (true) {
|
||||
if (offset > 0) {
|
||||
await new Promise((r) => setTimeout(r, 100));
|
||||
}
|
||||
const result = await fetchPage(offset, count);
|
||||
all.push(...result.data);
|
||||
offset += count;
|
||||
|
||||
Reference in New Issue
Block a user