Next.js website for Rocky Mountain Vending company featuring: - Product catalog with Stripe integration - Service areas and parts pages - Admin dashboard with Clerk authentication - SEO optimized pages with JSON-LD structured data Co-authored-by: Cursor <cursoragent@cursor.com>
13 lines
376 B
Text
13 lines
376 B
Text
export const retryWrapper = (toRetry, maxRetries, delayMs) => {
|
|
return async () => {
|
|
for (let i = 0; i < maxRetries; ++i) {
|
|
try {
|
|
return await toRetry();
|
|
}
|
|
catch (e) {
|
|
await new Promise((resolve) => setTimeout(resolve, delayMs));
|
|
}
|
|
}
|
|
return await toRetry();
|
|
};
|
|
};
|