yym68686 commited on
Commit
82c93cf
·
1 Parent(s): f0d6a67

Modify the stream read response timeout to 5 seconds.

Browse files
Files changed (1) hide show
  1. main.py +1 -1
main.py CHANGED
@@ -21,7 +21,7 @@ from urllib.parse import urlparse
21
  @asynccontextmanager
22
  async def lifespan(app: FastAPI):
23
  # 启动时的代码
24
- timeout = httpx.Timeout(connect=15.0, read=30.0, write=30.0, pool=30.0)
25
  app.state.client = httpx.AsyncClient(timeout=timeout)
26
  yield
27
  # 关闭时的代码
 
21
  @asynccontextmanager
22
  async def lifespan(app: FastAPI):
23
  # 启动时的代码
24
+ timeout = httpx.Timeout(connect=15.0, read=5.0, write=30.0, pool=30.0)
25
  app.state.client = httpx.AsyncClient(timeout=timeout)
26
  yield
27
  # 关闭时的代码