mirror of
https://github.com/netbirdio/netbird.git
synced 2026-04-16 07:16:38 +00:00
[management] get peer groups without lock (#4280)
This commit is contained in:
@@ -43,10 +43,10 @@ func (a *MockAccountManager) DeletePeer(_ context.Context, accountID, peerID, us
|
||||
a.mu.Lock()
|
||||
defer a.mu.Unlock()
|
||||
a.deletePeerCalls++
|
||||
delete(a.store.account.Peers, peerID)
|
||||
if a.wg != nil {
|
||||
a.wg.Done()
|
||||
}
|
||||
delete(a.store.account.Peers, peerID)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -1525,7 +1525,7 @@ func (am *DefaultAccountManager) getInactivePeers(ctx context.Context, accountID
|
||||
|
||||
// GetPeerGroups returns groups that the peer is part of.
|
||||
func (am *DefaultAccountManager) GetPeerGroups(ctx context.Context, accountID, peerID string) ([]*types.Group, error) {
|
||||
return am.Store.GetPeerGroups(ctx, store.LockingStrengthShare, accountID, peerID)
|
||||
return am.Store.GetPeerGroups(ctx, store.LockingStrengthNone, accountID, peerID)
|
||||
}
|
||||
|
||||
// getPeerGroupIDs returns the IDs of the groups that the peer is part of.
|
||||
|
||||
Reference in New Issue
Block a user