From 1932d489e57e849f1de3879f409ac0e47f6440c0 Mon Sep 17 00:00:00 2001 From: Neur0toxine Date: Tue, 10 Jan 2023 10:41:09 +0300 Subject: [PATCH] use provided reset period in counters --- core/healthcheck/counter.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/healthcheck/counter.go b/core/healthcheck/counter.go index 3a8c2dd..e8e1ede 100644 --- a/core/healthcheck/counter.go +++ b/core/healthcheck/counter.go @@ -99,7 +99,7 @@ func (a *AtomicCounter) ClearCountersProcessed() { } 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.success.Store(0) a.failure.Store(0)