Skip to content

Commit

Permalink
fix: only flush dirty metrics (#2418)
Browse files Browse the repository at this point in the history
  • Loading branch information
ldeffenb authored Aug 18, 2021
1 parent 586618a commit 87d83ed
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/topology/kademlia/internal/metrics/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 87d83ed

Please sign in to comment.