mirror of
https://github.com/netbirdio/netbird.git
synced 2026-04-22 10:16:38 +00:00
Fix timers
This commit is contained in:
@@ -24,8 +24,11 @@ func NewGuard(context context.Context, relayClient *Client) *Guard {
|
||||
}
|
||||
|
||||
func (g *Guard) OnDisconnected() {
|
||||
timeout := time.NewTimer(reconnectingTimeout)
|
||||
defer timeout.Stop()
|
||||
|
||||
select {
|
||||
case <-time.After(time.Second):
|
||||
case <-timeout.C:
|
||||
_ = g.relayClient.Connect()
|
||||
case <-g.ctx.Done():
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user