mirror of
https://github.com/prometheus/prometheus.git
synced 2025-03-05 20:59:13 -08:00
Merge pull request #821 from prometheus/beorn7/fix
Increment dirty counter only if setDirty(true) is called.
This commit is contained in:
commit
618a9d15f2
|
@ -316,7 +316,9 @@ func (p *persistence) isDirty() bool {
|
||||||
// dirty during our runtime, there is no way back. If we were dirty from the
|
// dirty during our runtime, there is no way back. If we were dirty from the
|
||||||
// start, a clean-up might make us clean again.)
|
// start, a clean-up might make us clean again.)
|
||||||
func (p *persistence) setDirty(dirty bool) {
|
func (p *persistence) setDirty(dirty bool) {
|
||||||
|
if dirty {
|
||||||
p.dirtyCounter.Inc()
|
p.dirtyCounter.Inc()
|
||||||
|
}
|
||||||
p.dirtyMtx.Lock()
|
p.dirtyMtx.Lock()
|
||||||
defer p.dirtyMtx.Unlock()
|
defer p.dirtyMtx.Unlock()
|
||||||
if p.becameDirty {
|
if p.becameDirty {
|
||||||
|
|
Loading…
Reference in a new issue