From 15b8c8f4c5b43a21a8ae46171a0a05241d96f9c8 Mon Sep 17 00:00:00 2001 From: Kristoffer Dalby Date: Fri, 6 Aug 2021 20:08:51 +0100 Subject: [PATCH] Remove lock from keepAlive --- api.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api.go b/api.go index b17f3eb3..820e3f48 100644 --- a/api.go +++ b/api.go @@ -455,7 +455,6 @@ func (h *Headscale) keepAlive(cancel chan []byte, pollData chan []byte, mKey wgk return default: - h.pollMu.Lock() data, err := h.getMapKeepAliveResponse(mKey, req, m) if err != nil { log.Error(). @@ -464,12 +463,13 @@ func (h *Headscale) keepAlive(cancel chan []byte, pollData chan []byte, mKey wgk Msg("Error generating the keep alive msg") return } + log.Debug(). Str("func", "keepAlive"). Str("machine", m.Name). Msg("Sending keepalive") pollData <- *data - h.pollMu.Unlock() + time.Sleep(60 * time.Second) } }