fix(canvas): 文本生成 - 修复分镜超时并贯通 Agent 与创作页流式返回
This commit is contained in:
@@ -234,6 +234,10 @@ func streamTaskTextEvents(c *gin.Context, svc *service.Service, userID string, t
|
||||
return
|
||||
}
|
||||
c.Writer.Flush()
|
||||
lastStatus := replay.Status
|
||||
lastStage := replay.Stage
|
||||
lastProgress := replay.Progress
|
||||
writeTaskTextSSE(c, "progress", 0, map[string]any{"status": replay.Status, "stage": replay.Stage, "progress": replay.Progress})
|
||||
|
||||
pollTicker := time.NewTicker(750 * time.Millisecond)
|
||||
heartbeatTicker := time.NewTicker(15 * time.Second)
|
||||
@@ -263,6 +267,10 @@ func streamTaskTextEvents(c *gin.Context, svc *service.Service, userID string, t
|
||||
writeTaskTextSSE(c, "error", 0, map[string]string{"message": "任务文本流不可用"})
|
||||
return
|
||||
}
|
||||
if next.Status != lastStatus || next.Stage != lastStage || next.Progress != lastProgress {
|
||||
writeTaskTextSSE(c, "progress", 0, map[string]any{"status": next.Status, "stage": next.Stage, "progress": next.Progress})
|
||||
lastStatus, lastStage, lastProgress = next.Status, next.Stage, next.Progress
|
||||
}
|
||||
replay = next
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user