Remove lock from keepAlive
This commit is contained in:
parent
4243885246
commit
15b8c8f4c5
1 changed files with 2 additions and 2 deletions
4
api.go
4
api.go
|
@ -455,7 +455,6 @@ func (h *Headscale) keepAlive(cancel chan []byte, pollData chan []byte, mKey wgk
|
||||||
return
|
return
|
||||||
|
|
||||||
default:
|
default:
|
||||||
h.pollMu.Lock()
|
|
||||||
data, err := h.getMapKeepAliveResponse(mKey, req, m)
|
data, err := h.getMapKeepAliveResponse(mKey, req, m)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error().
|
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")
|
Msg("Error generating the keep alive msg")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Debug().
|
log.Debug().
|
||||||
Str("func", "keepAlive").
|
Str("func", "keepAlive").
|
||||||
Str("machine", m.Name).
|
Str("machine", m.Name).
|
||||||
Msg("Sending keepalive")
|
Msg("Sending keepalive")
|
||||||
pollData <- *data
|
pollData <- *data
|
||||||
h.pollMu.Unlock()
|
|
||||||
time.Sleep(60 * time.Second)
|
time.Sleep(60 * time.Second)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue