fix: complete image_make asset delivery

This commit is contained in:
john
2026-07-19 19:09:26 +08:00
parent 32e697b698
commit a0043e95c1
7 changed files with 66 additions and 6 deletions
+3
View File
@@ -123,6 +123,9 @@ export function createImageMakeClient({
const deadline = Date.now() + overallTimeout;
let job = created;
if (!ACTIVE_STATUSES.has(String(job?.status ?? '')) && !job?.result && created?.status_url) {
job = await safeJson(await request(created.status_url));
}
while (ACTIVE_STATUSES.has(String(job?.status ?? ''))) {
if (Date.now() >= deadline) {
throw createClientError('IMAGE_MAKE_TIMEOUT', '图片生成超时', { jobId });