From b929aeeb4ec713d5ea36a58dbed3e42251f56312 Mon Sep 17 00:00:00 2001 From: Richard Ramos Date: Thu, 8 Dec 2022 15:48:16 -0400 Subject: [PATCH] fix: initial value of lastTimeExecuted --- waku/v2/node/keepalive.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/waku/v2/node/keepalive.go b/waku/v2/node/keepalive.go index f9b33e70..f0b6d6bf 100644 --- a/waku/v2/node/keepalive.go +++ b/waku/v2/node/keepalive.go @@ -24,7 +24,8 @@ func (w *WakuNode) startKeepAlive(t time.Duration) { ticker := time.NewTicker(t) defer ticker.Stop() - lastTimeExecuted := <-ticker.C + lastTimeExecuted := time.Now() + sleepDetectionInterval := int64(t) * 3 for {