mirror of
https://github.com/netbirdio/netbird.git
synced 2026-04-16 15:26:40 +00:00
[management] do not add ephemeral peer to deletion queue on logout
This commit is contained in:
@@ -937,6 +937,12 @@ func (s *GRPCServer) Logout(ctx context.Context, req *proto.EncryptedMessage) (*
|
||||
userID = activity.SystemInitiator
|
||||
}
|
||||
|
||||
// if peer is ephemeral, we need to set it to false to prevent adding it to ephemeral deletion queue
|
||||
if peer.Ephemeral {
|
||||
peer.Ephemeral = false
|
||||
}
|
||||
s.cancelPeerRoutines(ctx, peer.AccountID, peer)
|
||||
|
||||
if err = s.accountManager.DeletePeer(ctx, peer.AccountID, peer.ID, userID); err != nil {
|
||||
log.WithContext(ctx).Errorf("failed to logout peer %s: %v", peerKey.String(), err)
|
||||
return nil, mapError(ctx, err)
|
||||
|
||||
Reference in New Issue
Block a user