Skip to content

Commit

Permalink
Renamed loggerWithCurrentLag() to loggerWithCurrentLagIfSet()
Browse files Browse the repository at this point in the history
Signed-off-by: Marco Pracucci <[email protected]>
  • Loading branch information
pracucci committed Jul 2, 2024
1 parent 7f4b68e commit d2bd338
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/storage/ingest/reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ func (r *PartitionReader) processNextFetchesUntilLagHonored(ctx context.Context,

// This message is NOT expected to be logged with a very high rate. In this log we display the last measured
// lag. If we don't have it (lag is zero value), then it will not be logged.
level.Info(loggerWithCurrentLag(logger, currLag)).Log("msg", "partition reader is consuming records to honor target and max consumer lag", "partition_start_offset", partitionStartOffset, "last_produced_offset", lastProducedOffset)
level.Info(loggerWithCurrentLagIfSet(logger, currLag)).Log("msg", "partition reader is consuming records to honor target and max consumer lag", "partition_start_offset", partitionStartOffset, "last_produced_offset", lastProducedOffset)

for boff.Ongoing() {
// Continue reading until we reached the desired offset.
Expand Down Expand Up @@ -347,7 +347,7 @@ func isErrFetch(fetch kgo.Fetch) bool {
return false
}

func loggerWithCurrentLag(logger log.Logger, currLag time.Duration) log.Logger {
func loggerWithCurrentLagIfSet(logger log.Logger, currLag time.Duration) log.Logger {
if currLag <= 0 {
return logger
}
Expand Down

0 comments on commit d2bd338

Please sign in to comment.