mirror of
https://github.com/onepanelio/onepanel.git
synced 2025-10-18 19:44:31 +08:00
feat: updated workflow logs to return a response that may contain several log entries.
This commit is contained in:
@@ -249,14 +249,19 @@ func (s *WorkflowServer) GetWorkflowExecutionLogs(req *api.GetWorkflowExecutionL
|
||||
break
|
||||
}
|
||||
|
||||
for _, item := range le {
|
||||
if err := stream.Send(&api.LogEntry{
|
||||
apiLogEntries := make([]*api.LogEntry, len(le))
|
||||
for i, item := range le {
|
||||
apiLogEntries[i] = &api.LogEntry{
|
||||
Timestamp: item.Timestamp.Format(time.RFC3339),
|
||||
Content: item.Content,
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
if err := stream.Send(&api.LogStreamResponse{
|
||||
LogEntries: apiLogEntries,
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
|
Reference in New Issue
Block a user