fix: 任务创建后直接进入 running 状态,避免前端显示排队中

- 移除任务初始状态 pending,改为直接创建为 running
- 初始进度设为 5%,stage 设为 prompt_builder
- 更新文档以反映实际执行流程(无队列机制)
- 修复前端轮询时因竞态条件显示排队中的问题
This commit is contained in:
2026-05-25 18:16:21 +08:00
parent 0a4f1c44c0
commit 0847d126a2
3 changed files with 32 additions and 91 deletions
+3 -2
View File
@@ -236,8 +236,9 @@ func saveTaskToDB(ctx context.Context, projectID, taskID string, req GenerateReq
ProjectID: uint(projectIDUint),
Prompt: req.Prompt,
AssetType: req.AssetType,
Status: "pending",
Progress: 0,
Status: "running",
Progress: 5,
Stage: "prompt_builder",
RetryCount: 0,
CreatedAt: time.Now(),
UpdatedAt: time.Now(),