Skip to content

Commit

Permalink
Remove lock from keepAlive
Browse files Browse the repository at this point in the history
  • Loading branch information
kradalby committed Aug 6, 2021
1 parent 4243885 commit 15b8c8f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api.go
Original file line number Diff line number Diff line change
Expand Up @@ -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().
Expand All @@ -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)
}
}
Expand Down

0 comments on commit 15b8c8f

Please sign in to comment.