fix goroutine leak
This commit is contained in:
parent
3e9ee816f9
commit
5feadbf3fc
|
@ -664,7 +664,11 @@ func (h *Headscale) scheduledPollWorker(
|
||||||
Str("machine", machine.Hostname).
|
Str("machine", machine.Hostname).
|
||||||
Bool("noise", isNoise).
|
Bool("noise", isNoise).
|
||||||
Msg("Sending keepalive")
|
Msg("Sending keepalive")
|
||||||
keepAliveChan <- data
|
select {
|
||||||
|
case keepAliveChan <- data:
|
||||||
|
case <-ctx.Done():
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
case <-updateCheckerTicker.C:
|
case <-updateCheckerTicker.C:
|
||||||
log.Debug().
|
log.Debug().
|
||||||
|
@ -674,7 +678,11 @@ func (h *Headscale) scheduledPollWorker(
|
||||||
Msg("Sending update request")
|
Msg("Sending update request")
|
||||||
updateRequestsFromNode.WithLabelValues(machine.Namespace.Name, machine.Hostname, "scheduled-update").
|
updateRequestsFromNode.WithLabelValues(machine.Namespace.Name, machine.Hostname, "scheduled-update").
|
||||||
Inc()
|
Inc()
|
||||||
updateChan <- struct{}{}
|
select {
|
||||||
|
case updateChan <- struct{}{}:
|
||||||
|
case <-ctx.Done():
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue