multimodalart HF Staff commited on
Commit
db100dd
·
verified ·
1 Parent(s): 0a8c984

Update proxy.js

Browse files
Files changed (1) hide show
  1. proxy.js +5 -0
proxy.js CHANGED
@@ -38,6 +38,11 @@ async function retryWith503Backoff(url, options, startTime) {
38
  return response;
39
  }
40
 
 
 
 
 
 
41
  // For 503: retry with exponential backoff until max time
42
  // For other errors: retry up to 3 times, then return the error
43
  if (response.status === 503) {
 
38
  return response;
39
  }
40
 
41
+ // Don't retry 401 (Unauthorized) - return immediately
42
+ if (response.status === 401) {
43
+ return response;
44
+ }
45
+
46
  // For 503: retry with exponential backoff until max time
47
  // For other errors: retry up to 3 times, then return the error
48
  if (response.status === 503) {