From 709127cbfaa95a6f6ecc92d45359c8cc299d7bd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?ACT=E4=B8=B6=E6=B5=81=E6=98=9F=E9=9B=A8?= <1340145680@qq.com> Date: Thu, 5 Feb 2026 10:15:41 +0800 Subject: [PATCH] no message --- src/utils/ai/video/owned/volcengine.ts | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/src/utils/ai/video/owned/volcengine.ts b/src/utils/ai/video/owned/volcengine.ts index 8729fad..9f9aa1d 100644 --- a/src/utils/ai/video/owned/volcengine.ts +++ b/src/utils/ai/video/owned/volcengine.ts @@ -1,6 +1,6 @@ import "../type"; import axios from "axios"; -import u from "@/utils"; +import { pollTask } from "@/utils/ai/utils"; interface DoubaoVideoConfig { prompt: string; @@ -11,20 +11,6 @@ interface DoubaoVideoConfig { audio?: boolean; } -const pollTask = async ( - queryFn: () => Promise<{ completed: boolean; imageUrl?: string; error?: string }>, - maxAttempts = 500, - interval = 2000, -): Promise => { - for (let i = 0; i < maxAttempts; i++) { - await new Promise((resolve) => setTimeout(resolve, interval)); - const { completed, imageUrl, error } = await queryFn(); - if (error) throw new Error(error); - if (completed && imageUrl) return imageUrl; - } - throw new Error(`任务轮询超时,已尝试 ${maxAttempts} 次`); -}; - export default async (input: ImageConfig, config: AIConfig) => { console.log("%c Line:5 🍓 input", "background:#7f2b82", input); console.log("%c Line:5 🍎 config", "background:#93c0a4", config);