Skip to content

Commit

Permalink
NEOS-1724: updates runs logs query to use close time if workflow has …
Browse files Browse the repository at this point in the history
…ended (#3174)
  • Loading branch information
nickzelei authored Jan 22, 2025
1 parent 814b63f commit d2315fc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion backend/services/mgmt/v1alpha1/job-service/runs.go
Original file line number Diff line number Diff line change
Expand Up @@ -608,12 +608,15 @@ func (s *Service) streamLokiWorkerLogs(
}
workflowExecution, err := s.temporalmgr.GetWorkflowExecutionById(ctx, req.GetAccountId(), req.GetJobRunId(), logger)
if err != nil {
return err
return fmt.Errorf("unable to retrieve workflow execution: %w", err)
}

lokiclient := loki.New(s.cfg.RunLogConfig.LokiRunLogConfig.BaseUrl, http.DefaultClient)
direction := loki.BACKWARD
end := time.Now()
if workflowExecution.CloseTime != nil {
end = workflowExecution.CloseTime.AsTime()
}
start := getLogFilterTime(req.GetWindow(), end)
query := buildLokiQuery(
s.cfg.RunLogConfig.LokiRunLogConfig.LabelsQuery,
Expand Down
2 changes: 1 addition & 1 deletion internal/javascript/vm/vm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func TestRunner(t *testing.T) {
wg.Add(1)
go func() {
defer wg.Done()
_, err = runner.Run(context.Background(), program)
_, err := runner.Run(context.Background(), program)
require.NoError(t, err)
}()
}
Expand Down

0 comments on commit d2315fc

Please sign in to comment.