Move write peer lock (#2364)

Moved the write peer lock to avoid latency caused by disk access

Updated the method CancelPeerRoutines to use the peer public key
This commit is contained in:
Maycon Santos
2024-07-31 21:51:45 +02:00
committed by GitHub
parent c832cef44c
commit 5ee9c77e90
3 changed files with 17 additions and 11 deletions

View File

@ -236,7 +236,7 @@ func (s *GRPCServer) sendUpdate(ctx context.Context, peerKey wgtypes.Key, peer *
func (s *GRPCServer) cancelPeerRoutines(ctx context.Context, peer *nbpeer.Peer) {
s.peersUpdateManager.CloseChannel(ctx, peer.ID)
s.turnCredentialsManager.CancelRefresh(peer.ID)
_ = s.accountManager.CancelPeerRoutines(ctx, peer)
_ = s.accountManager.CancelPeerRoutines(ctx, peer.Key)
s.ephemeralManager.OnPeerDisconnected(ctx, peer)
}