XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet
公开
关注 0 Fork 0 Star 1
返回提交历史

XFEstudio/gpt4free

perf(api): tune uvicorn keep-alive and connection backlog for high throughput

ba57d541
Anand Mall <anand@example.com>
提交于

代码差异

1 个文件 +7 -1
Modified g4f/api/__init__.py +7 -1
@@ -2380,11 +2380,17 @@ def run_api(
2380 2380 else:
2381 2381 method = "create_app_debug" if debug else "create_app"
2382 2382
2383 uvicorn_options = {
2384 "timeout_keep_alive": 65,
2385 "backlog": 2048,
2386 }
2387 uvicorn_options.update(filter_none(**kwargs))
2388
2383 2389 uvicorn.run(
2384 2390 f"g4f.api:{method}",
2385 2391 host=host,
2386 2392 port=int(port),
2387 2393 factory=True,
2388 2394 use_colors=use_colors,
2389 **filter_none(**kwargs),
2395 **uvicorn_options,
2390 2396 )