From 3a2eabae1d5d612c0793ca5ed1c396a7d63a20e1 Mon Sep 17 00:00:00 2001 From: Ed Welch Date: Thu, 23 Apr 2020 16:47:16 -0400 Subject: [PATCH] make min time a constant Signed-off-by: Ed Welch --- pkg/logql/engine.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/logql/engine.go b/pkg/logql/engine.go index b2a8ec4a490c8..31404287deeb6 100644 --- a/pkg/logql/engine.go +++ b/pkg/logql/engine.go @@ -26,6 +26,7 @@ var ( Help: "LogQL query timings", Buckets: prometheus.DefBuckets, }, []string{"query_type"}) + lastEntryMinTime = time.Unix(-100, 0) ) // ValueTypeStreams promql.ValueType for log streams @@ -304,7 +305,7 @@ func readStreams(i iter.EntryIterator, size uint32, dir logproto.Direction, inte respSize := uint32(0) // lastEntry should be a really old time so that the first comparison is always true, we use a negative // value here because many unit tests start at time.Unix(0,0) - lastEntry := time.Unix(-100, 0) + lastEntry := lastEntryMinTime for respSize < size && i.Next() { labels, entry := i.Labels(), i.Entry() forwardShouldOutput := dir == logproto.FORWARD &&