fix: issues with finished logs. Content was repeating, resulting in a large data load - making the stream fail.

No timestamps were being returned as timestamps for time 0.
Occasionally lines would cut off across multiple lines.
This commit is contained in:
Andrey Melnikov
2020-12-31 11:07:39 -08:00
parent 69c523ee23
commit 080624d9e2
2 changed files with 38 additions and 6 deletions

View File

@@ -242,7 +242,7 @@ func (s *WorkflowServer) GetWorkflowExecutionLogs(req *api.GetWorkflowExecutionL
return err
}
le := []*v1.LogEntry{}
le := make([]*v1.LogEntry, 0)
for {
le = <-watcher
if le == nil {
@@ -252,8 +252,11 @@ func (s *WorkflowServer) GetWorkflowExecutionLogs(req *api.GetWorkflowExecutionL
apiLogEntries := make([]*api.LogEntry, len(le))
for i, item := range le {
apiLogEntries[i] = &api.LogEntry{
Timestamp: item.Timestamp.Format(time.RFC3339),
Content: item.Content,
Content: item.Content,
}
if item.Timestamp.After(time.Time{}) {
apiLogEntries[i].Timestamp = item.Timestamp.Format(time.RFC3339)
}
}