mirror of
https://github.com/prometheus/prometheus
synced 2025-02-23 08:07:18 +00:00
should use time.Since instead of time.Now().Sub
Signed-off-by: wgliang <liangcszzu@163.com>
This commit is contained in:
parent
70f3d1e9f9
commit
7e6c6020ff
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user