fix: logs io buffer combine

This commit is contained in:
engigu
2026-02-08 11:03:11 +08:00
parent b291e3740f
commit 6402943462
9 changed files with 67 additions and 27 deletions
+4 -1
View File
@@ -81,6 +81,7 @@ type TaskResult struct {
AgentID uint `json:"agent_id"` // 仅用于 HTTP 上报时后端补充
Command string `json:"command"`
Output string `json:"output"`
Error string `json:"error"`
Status string `json:"status"`
Duration int64 `json:"duration"`
ExitCode int `json:"exit_code"`
@@ -175,6 +176,7 @@ func (h *AgentHandler) OnTaskCompleted(req *executor.ExecutionRequest, result *e
LogID: result.LogID,
Command: req.Command,
Output: result.Output,
Error: result.Error,
Status: result.Status,
Duration: result.Duration,
ExitCode: result.ExitCode,
@@ -203,7 +205,8 @@ func (h *AgentHandler) OnTaskFailed(req *executor.ExecutionRequest, err error) {
TaskID: taskID,
LogID: req.LogID,
Command: req.Command,
Output: errMsg,
Output: "",
Error: err.Error(),
Status: "failed",
Duration: 0,
ExitCode: 1,