luojunhui 2 tygodni temu
rodzic
commit
6f2efb60a5
1 zmienionych plików z 3 dodań i 3 usunięć
  1. 3 3
      app/infra/internal/aigc_decode_server.py

+ 3 - 3
app/infra/internal/aigc_decode_server.py

@@ -31,7 +31,7 @@ class AigcDecodeServer:
                 "posts": self._sanitize_images(posts),
             }
         }
-        async with AsyncHttpClient() as client:
+        async with AsyncHttpClient(timeout=180) as client:
             return await client.post(url, json=payload, headers=headers)
 
     async def query_decode_results(
@@ -45,7 +45,7 @@ class AigcDecodeServer:
         payload = {
             "params": {"configId": config_id, "channelContentIds": channel_content_ids}
         }
-        async with AsyncHttpClient() as client:
+        async with AsyncHttpClient(timeout=60) as client:
             return await client.post(url, json=payload, headers=headers)
 
     async def cancel_decode_tasks(
@@ -59,7 +59,7 @@ class AigcDecodeServer:
         payload = {
             "params": {"configId": config_id, "channelContentIds": channel_content_ids}
         }
-        async with AsyncHttpClient() as client:
+        async with AsyncHttpClient(timeout=30) as client:
             return await client.post(url, json=payload, headers=headers)