feat: opt exec log

This commit is contained in:
engigu
2026-01-01 14:42:33 +08:00
parent 4dfd45ec69
commit 756ba1e0ea
9 changed files with 115 additions and 30 deletions
+10 -5
View File
@@ -195,12 +195,17 @@ func (es *ExecutorService) saveTaskLogCallback(taskID uint, command string, resu
status = "failed"
}
startTime := models.LocalTime(result.Start)
endTime := models.LocalTime(result.End)
taskLog := &models.TaskLog{
TaskID: taskID,
Command: command,
Output: compressed,
Status: status,
Duration: result.End.Sub(result.Start).Milliseconds(),
TaskID: taskID,
Command: command,
Output: compressed,
Status: status,
Duration: result.End.Sub(result.Start).Milliseconds(),
StartTime: &startTime,
EndTime: &endTime,
}
if err := database.DB.Create(taskLog).Error; err != nil {