Moonfanz commited on
Commit
5375011
·
verified ·
1 Parent(s): c102e42

Upload 2 files

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -365,11 +365,11 @@ def handle_api_error(error, attempt, current_api_key):
365
  else:
366
  delay = min(RETRY_DELAY * (2 ** attempt), MAX_RETRY_DELAY)
367
  logger.warning(
368
- f"{current_api_key[:8]} ... {current_api_key[-3:]} → {status_code} 未知错误 → {delay} 秒后重试..."
369
  )
370
  switch_api_key()
371
  time.sleep(delay)
372
- return 0, None
373
 
374
  elif isinstance(error, requests.exceptions.ConnectionError):
375
  delay = min(RETRY_DELAY * (2 ** attempt), MAX_RETRY_DELAY)
 
365
  else:
366
  delay = min(RETRY_DELAY * (2 ** attempt), MAX_RETRY_DELAY)
367
  logger.warning(
368
+ f"{current_api_key[:8]} ... {current_api_key[-3:]} → {status_code} 未知错误/模型不可用 → {delay} 秒后重试..."
369
  )
370
  switch_api_key()
371
  time.sleep(delay)
372
+ return 2, None
373
 
374
  elif isinstance(error, requests.exceptions.ConnectionError):
375
  delay = min(RETRY_DELAY * (2 ** attempt), MAX_RETRY_DELAY)