Moonfanz commited on
Commit
386e12e
·
verified ·
1 Parent(s): f2f073d

Upload 4 files

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -213,7 +213,6 @@ def chat_completions():
213
  def do_request(current_api_key, attempt):
214
  if not is_within_rate_limit(current_api_key):
215
  logger.warning(f"{current_api_key[:11]} → 暂时超过限额")
216
- key_manager.blacklist_key(current_api_key)
217
  switch_api_key()
218
  return False, None
219
 
@@ -275,10 +274,10 @@ def chat_completions():
275
  success, response = do_request(current_api_key, attempt)
276
 
277
  if not success:
278
- logger.error(f" {MAX_RETRIES} 次尝试均失败,请修改预设")
279
  response = {
280
  'error': {
281
- 'message': f' {MAX_RETRIES} 次尝试均失败,请修改预设',
282
  'type': 'internal_server_error'
283
  }
284
  }
 
213
  def do_request(current_api_key, attempt):
214
  if not is_within_rate_limit(current_api_key):
215
  logger.warning(f"{current_api_key[:11]} → 暂时超过限额")
 
216
  switch_api_key()
217
  return False, None
218
 
 
274
  success, response = do_request(current_api_key, attempt)
275
 
276
  if not success:
277
+ logger.error(f" {MAX_RETRIES} 次尝试均失败,请调整配置或询问Moonfanz")
278
  response = {
279
  'error': {
280
+ 'message': f' {MAX_RETRIES} 次尝试均失败,请调整配置或询问Moonfanz',
281
  'type': 'internal_server_error'
282
  }
283
  }