fix(video-gen): use fal.ai status_url from submit response + add logging
Use the status_url returned by fal.ai submit instead of constructing it manually. Add logging for submit success and poll HTTP errors to debug Seedance queue status polling. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
d4877abff9
commit
0b1e33e1d2
|
|
@ -1243,20 +1243,23 @@ async function processVideoGenJob(job: VideoGenJob) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const { request_id } = await submitRes.json() as { request_id: string };
|
const submitData = await submitRes.json() as { request_id: string; status_url?: string; response_url?: string };
|
||||||
|
const request_id = submitData.request_id;
|
||||||
|
const statusPollUrl = submitData.status_url || `https://queue.fal.run/${MODEL}/requests/${request_id}/status`;
|
||||||
|
let responseUrl = submitData.response_url || "";
|
||||||
|
console.log(`[video-gen] Job ${job.id} submitted (model=${MODEL}, reqId=${request_id})`);
|
||||||
|
|
||||||
// Poll for completion (up to 10 min)
|
// Poll for completion (up to 10 min)
|
||||||
const deadline = Date.now() + 600_000;
|
const deadline = Date.now() + 600_000;
|
||||||
let responseUrl = "";
|
|
||||||
let completed = false;
|
let completed = false;
|
||||||
|
|
||||||
while (Date.now() < deadline) {
|
while (Date.now() < deadline) {
|
||||||
await new Promise((r) => setTimeout(r, 3000));
|
await new Promise((r) => setTimeout(r, 3000));
|
||||||
const statusRes = await fetch(
|
const statusRes = await fetch(statusPollUrl, { headers: falHeaders });
|
||||||
`https://queue.fal.run/${MODEL}/requests/${request_id}/status`,
|
if (!statusRes.ok) {
|
||||||
{ headers: falHeaders },
|
console.log(`[video-gen] Poll ${job.id}: status HTTP ${statusRes.status}`);
|
||||||
);
|
continue;
|
||||||
if (!statusRes.ok) continue;
|
}
|
||||||
const statusData = await statusRes.json() as { status: string; response_url?: string; queue_position?: number };
|
const statusData = await statusRes.json() as { status: string; response_url?: string; queue_position?: number };
|
||||||
console.log(`[video-gen] Poll ${job.id}: status=${statusData.status}`);
|
console.log(`[video-gen] Poll ${job.id}: status=${statusData.status}`);
|
||||||
job.falStatus = statusData.status;
|
job.falStatus = statusData.status;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue