yym68686 commited on
Commit
3fc76ba
·
1 Parent(s): 94c81e3

🐛 Bug: Fix the bug where the timeout was not converted to a float.

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
  async def lifespan(app: FastAPI):
22
  # 启动时的代码
23
  import os
24
- TIMEOUT = os.getenv("TIMEOUT", 20)
25
  timeout = httpx.Timeout(connect=15.0, read=TIMEOUT, write=30.0, pool=30.0)
26
  default_headers = {
27
  "User-Agent": "curl/7.68.0", # 模拟 curl 的 User-Agent
 
21
  async def lifespan(app: FastAPI):
22
  # 启动时的代码
23
  import os
24
+ TIMEOUT = float(os.getenv("TIMEOUT", 20))
25
  timeout = httpx.Timeout(connect=15.0, read=TIMEOUT, write=30.0, pool=30.0)
26
  default_headers = {
27
  "User-Agent": "curl/7.68.0", # 模拟 curl 的 User-Agent