fix(media): 视频任务 - 统一轮询超时并支持失败任务人工恢复
This commit is contained in:
@@ -24,6 +24,7 @@ export type GenerationTask = {
|
||||
operation?: string;
|
||||
provider?: string;
|
||||
model?: string;
|
||||
providerRequestId?: string;
|
||||
errorCode?: string;
|
||||
previewUrl?: string;
|
||||
previewKind?: "image" | "video";
|
||||
@@ -43,6 +44,13 @@ export type GenerationTask = {
|
||||
updated_at?: string;
|
||||
};
|
||||
|
||||
export type ProviderTaskQueryResult = {
|
||||
task: GenerationTask;
|
||||
providerStatus: string;
|
||||
recovered: boolean;
|
||||
billingSettled: boolean;
|
||||
};
|
||||
|
||||
export type AgentSession = {
|
||||
id: string;
|
||||
projectId?: string;
|
||||
@@ -185,6 +193,10 @@ export function retryGenerationTask(id: string) {
|
||||
return request<GenerationTask>(api.post(`/tasks/${encodeURIComponent(id)}/retry`));
|
||||
}
|
||||
|
||||
export function queryFailedVideoProviderTask(id: string) {
|
||||
return request<ProviderTaskQueryResult>(api.post(`/tasks/${encodeURIComponent(id)}/query-provider`));
|
||||
}
|
||||
|
||||
export function cancelGenerationTask(id: string) {
|
||||
return request<GenerationTask>(api.post(`/tasks/${encodeURIComponent(id)}/cancel`));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user