fix: 任务创建后直接进入 running 状态,避免前端显示排队中
- 移除任务初始状态 pending,改为直接创建为 running - 初始进度设为 5%,stage 设为 prompt_builder - 更新文档以反映实际执行流程(无队列机制) - 修复前端轮询时因竞态条件显示排队中的问题
This commit is contained in:
@@ -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(),
|
||||
|
||||
Reference in New Issue
Block a user