mirror of
https://github.com/retailcrm/mg-transport-core.git
synced 2024-11-22 13:16:04 +03:00
use provided reset period in counters
This commit is contained in:
commit
312de3f19e
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user