Skip to content

Commit 0b28654

Browse files
committed
增加超时时间
1 parent 4461191 commit 0b28654

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/httpx_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ async def post_async(
7474
data: Any = None,
7575
json: Any = None,
7676
headers: Optional[Dict[str, str]] = None,
77-
timeout: float = 600.0,
77+
timeout: float = 900.0,
7878
**kwargs,
7979
) -> httpx.Response:
8080
"""通用异步POST请求"""

web.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,8 @@ async def _run():
180180
config.loglevel = "INFO"
181181

182182
# 设置连接超时
183-
config.keep_alive_timeout = 600
184-
config.read_timeout = 600
183+
config.keep_alive_timeout = 900
184+
config.read_timeout = 900
185185

186186
await serve(app, config)
187187

@@ -206,8 +206,8 @@ async def _run():
206206
config.loglevel = "INFO"
207207
config.workers = workers
208208
config.application_path = "web:app"
209-
config.keep_alive_timeout = 600
210-
config.read_timeout = 600
209+
config.keep_alive_timeout = 900
210+
config.read_timeout = 900
211211

212212
run(config)
213213

0 commit comments

Comments
 (0)