Commit 87d83ed7 authored by ldeffenb's avatar ldeffenb Committed by GitHub

fix: only flush dirty metrics (#2418)

parent 586618af
......@@ -164,7 +164,7 @@ type Counters struct {
// flush writes the current state of in memory counters into the given db.
func (cs *Counters) flush(db *shed.DB, batch *leveldb.Batch) error {
if cs.dirty.Load() > 1 {
if cs.dirty.Load() < 3 {
return nil
}
cs.dirty.CAS(3, 2)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment