3
This commit is contained in:
@@ -2416,8 +2416,15 @@ class ProvisionerBot:
|
||||
skipped.append(key)
|
||||
continue
|
||||
|
||||
# 测试 Key 是否有效
|
||||
success, msg = gptmail_service.test_api_key(key)
|
||||
# 测试 Key 是否有效 (使用线程池避免阻塞,带超时)
|
||||
try:
|
||||
success, msg = await asyncio.wait_for(
|
||||
asyncio.to_thread(gptmail_service.test_api_key, key),
|
||||
timeout=15
|
||||
)
|
||||
except asyncio.TimeoutError:
|
||||
invalid.append(key)
|
||||
continue
|
||||
|
||||
if not success:
|
||||
invalid.append(key)
|
||||
|
||||
Reference in New Issue
Block a user