From 7e6c6020ffc593f1c4c907cb23f6c57886e6187a Mon Sep 17 00:00:00 2001 From: wangguoliang Date: Thu, 7 Sep 2017 18:00:45 +0800 Subject: [PATCH] should use time.Since instead of time.Now().Sub Signed-off-by: wgliang --- storage/local/series.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/local/series.go b/storage/local/series.go index fe30e9f77c..f58371746a 100644 --- a/storage/local/series.go +++ b/storage/local/series.go @@ -255,7 +255,7 @@ func (s *memorySeries) maybeCloseHeadChunk(timeout time.Duration) (bool, error) if s.headChunkClosed { return false, nil } - if time.Now().Sub(s.lastTime.Time()) > timeout { + if time.Since(s.lastTime.Time()) > timeout { s.headChunkClosed = true // Since we cannot modify the head chunk from now on, we // don't need to bother with cloning anymore.