mirror of
https://github.com/netbirdio/netbird.git
synced 2025-06-21 18:22:37 +02:00
Fix wg state check exit logic
This commit is contained in:
parent
efa0bbdf3d
commit
b62ad97e59
@ -63,10 +63,8 @@ func (w *WorkerRelay) OnNewOffer(remoteOfferAnswer *OfferAnswer) {
|
|||||||
|
|
||||||
srv := w.preferredRelayServer(currentRelayAddress, remoteOfferAnswer.RelaySrvAddress)
|
srv := w.preferredRelayServer(currentRelayAddress, remoteOfferAnswer.RelaySrvAddress)
|
||||||
|
|
||||||
w.ctx, w.ctxCancel = context.WithCancel(w.parentCtx)
|
|
||||||
relayedConn, err := w.relayManager.OpenConn(srv, w.config.Key, w.disconnected)
|
relayedConn, err := w.relayManager.OpenConn(srv, w.config.Key, w.disconnected)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
w.ctxCancel()
|
|
||||||
// todo handle all type errors
|
// todo handle all type errors
|
||||||
if errors.Is(err, relayClient.ErrConnAlreadyExists) {
|
if errors.Is(err, relayClient.ErrConnAlreadyExists) {
|
||||||
w.log.Infof("do not need to reopen relay connection")
|
w.log.Infof("do not need to reopen relay connection")
|
||||||
@ -76,6 +74,8 @@ func (w *WorkerRelay) OnNewOffer(remoteOfferAnswer *OfferAnswer) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
w.ctx, w.ctxCancel = context.WithCancel(w.parentCtx)
|
||||||
|
|
||||||
go w.wgStateCheck(relayedConn)
|
go w.wgStateCheck(relayedConn)
|
||||||
|
|
||||||
w.log.Debugf("Relay connection established with %s", srv)
|
w.log.Debugf("Relay connection established with %s", srv)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user