Spaces:
Running
Running
Kling Motion: extend poll timeout to 25 min (300x5s)
Browse files
src/content_engine/api/routes_video.py
CHANGED
|
@@ -329,7 +329,7 @@ async def _generate_kling_motion_video(
|
|
| 329 |
_video_jobs[job_id]["message"] = "Calling Kling Motion Control API..."
|
| 330 |
logger.info("Calling Kling Motion Control: %s", endpoint)
|
| 331 |
|
| 332 |
-
async with httpx.AsyncClient(timeout=
|
| 333 |
resp = await client.post(
|
| 334 |
endpoint,
|
| 335 |
json=payload,
|
|
@@ -352,7 +352,7 @@ async def _generate_kling_motion_video(
|
|
| 352 |
urls_data = data.get("urls", {})
|
| 353 |
if not outputs and urls_data.get("get"):
|
| 354 |
_video_jobs[job_id]["message"] = "Waiting for Kling Motion to complete..."
|
| 355 |
-
video_url_out = await _poll_wavespeed_video(urls_data["get"], api_key, job_id)
|
| 356 |
elif outputs:
|
| 357 |
video_url_out = outputs[0] if isinstance(outputs[0], str) else outputs[0].get("url")
|
| 358 |
else:
|
|
|
|
| 329 |
_video_jobs[job_id]["message"] = "Calling Kling Motion Control API..."
|
| 330 |
logger.info("Calling Kling Motion Control: %s", endpoint)
|
| 331 |
|
| 332 |
+
async with httpx.AsyncClient(timeout=60) as client:
|
| 333 |
resp = await client.post(
|
| 334 |
endpoint,
|
| 335 |
json=payload,
|
|
|
|
| 352 |
urls_data = data.get("urls", {})
|
| 353 |
if not outputs and urls_data.get("get"):
|
| 354 |
_video_jobs[job_id]["message"] = "Waiting for Kling Motion to complete..."
|
| 355 |
+
video_url_out = await _poll_wavespeed_video(urls_data["get"], api_key, job_id, max_attempts=300, interval=5.0)
|
| 356 |
elif outputs:
|
| 357 |
video_url_out = outputs[0] if isinstance(outputs[0], str) else outputs[0].get("url")
|
| 358 |
else:
|