use provided reset period in counters

This commit is contained in:
Pavel 2023-01-10 10:41:09 +03:00
parent 6385bc177f
commit 1932d489e5

View File

@ -99,7 +99,7 @@ func (a *AtomicCounter) ClearCountersProcessed() {
} }
func (a *AtomicCounter) FlushCounters() { func (a *AtomicCounter) FlushCounters() {
if time.Now().After(a.timestamp.Load().Add(time.Minute * 15)) { if time.Now().After(a.timestamp.Load().Add(a.resetPeriod)) {
a.timestamp.Store(time.Now()) a.timestamp.Store(time.Now())
a.success.Store(0) a.success.Store(0)
a.failure.Store(0) a.failure.Store(0)