Skip to content

Supercharge your AI agents with data from the web and beyond. Building the library for superintelligence. 🔥

fix(api/gcs): treat 503 as slowdown for better success rate

mogerycd1dcb252679
diff --git a/apps/api/src/lib/gcs-jobs.ts b/apps/api/src/lib/gcs-jobs.ts
index 70e0f2da6..3203da93a 100644
--- a/apps/api/src/lib/gcs-jobs.ts
+++ b/apps/api/src/lib/gcs-jobs.ts
@@ -139,8 +139,11 @@ async function saveJobToGCS(params: {
});
break;
} catch (error) {
- if (error instanceof ApiError && error.code === 429) {
- // switch to slower backoff parameters for rate limiting errors
+ if (
+ error instanceof ApiError &&
+ (error.code === 429 || error.code === 503)
+ ) {
+ // switch to slower backoff parameters for rate limiting or server overloaded errors
backoffUsed = BACKOFF_SLOWDOWN_PARAMS;
}