mirror of
https://github.com/prometheus/prometheus.git
synced 2025-02-21 03:16:00 -08: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 {
|
if s.headChunkClosed {
|
||||||
return false, nil
|
return false, nil
|
||||||
}
|
}
|
||||||
if time.Now().Sub(s.lastTime.Time()) > timeout {
|
if time.Since(s.lastTime.Time()) > timeout {
|
||||||
s.headChunkClosed = true
|
s.headChunkClosed = true
|
||||||
// Since we cannot modify the head chunk from now on, we
|
// Since we cannot modify the head chunk from now on, we
|
||||||
// don't need to bother with cloning anymore.
|
// don't need to bother with cloning anymore.
|
||||||
|
|
Loading…
Reference in a new issue