Skip to content

Commit

Permalink
Review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
bgedik committed Oct 18, 2024
1 parent 0a12e95 commit 4d0ee5d
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ func (e *earliestFileErrorReader) IsError(ctx context.Context) (bool, error) {
}

func (e *earliestFileErrorReader) ReadError(ctx context.Context) (io.ExecutionError, error) {
var earliestTimestamp time.Time = time.Now()
var earliestTimestamp *time.Time = nil
earliestExecutionError := io.ExecutionError{}
const maxItems = 1000
cursor := storage.NewCursorAtStart()
Expand All @@ -167,9 +167,9 @@ func (e *earliestFileErrorReader) ReadError(ctx context.Context) (io.ExecutionEr
return io.ExecutionError{}, errors.Wrapf(err, "failed to read error file @[%s]", errorFilePath.String())
}

Check warning on line 168 in flyteplugins/go/tasks/pluginmachinery/ioutils/remote_file_output_reader.go

View check run for this annotation

Codecov / codecov/patch

flyteplugins/go/tasks/pluginmachinery/ioutils/remote_file_output_reader.go#L167-L168

Added lines #L167 - L168 were not covered by tests
timestamp := errorDoc.Error.GetTimestamp().AsTime()
if earliestTimestamp.After(timestamp) {
if earliestTimestamp == nil || earliestTimestamp.After(timestamp) {
earliestExecutionError = errorDoc2ExecutionError(errorDoc, errorFilePath)
earliestTimestamp = timestamp
earliestTimestamp = &timestamp
}
}
}
Expand Down

0 comments on commit 4d0ee5d

Please sign in to comment.