mirror of
https://github.com/netbirdio/netbird.git
synced 2025-01-25 15:28:38 +01:00
remove early unlock
This commit is contained in:
parent
b50a23fdfd
commit
0a5bd01798
@ -744,11 +744,7 @@ func (am *DefaultAccountManager) LoginPeer(ctx context.Context, login PeerLogin)
|
|||||||
unlockAccount := am.Store.AcquireReadLockByUID(ctx, accountID)
|
unlockAccount := am.Store.AcquireReadLockByUID(ctx, accountID)
|
||||||
defer unlockAccount()
|
defer unlockAccount()
|
||||||
unlockPeer := am.Store.AcquireWriteLockByUID(ctx, login.WireGuardPubKey)
|
unlockPeer := am.Store.AcquireWriteLockByUID(ctx, login.WireGuardPubKey)
|
||||||
defer func() {
|
defer unlockPeer()
|
||||||
if unlockPeer != nil {
|
|
||||||
unlockPeer()
|
|
||||||
}
|
|
||||||
}()
|
|
||||||
|
|
||||||
peer, err := am.Store.GetPeerByPeerPubKey(ctx, store.LockingStrengthUpdate, login.WireGuardPubKey)
|
peer, err := am.Store.GetPeerByPeerPubKey(ctx, store.LockingStrengthUpdate, login.WireGuardPubKey)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -818,9 +814,6 @@ func (am *DefaultAccountManager) LoginPeer(ctx context.Context, login PeerLogin)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
unlockPeer()
|
|
||||||
unlockPeer = nil
|
|
||||||
|
|
||||||
account, err := am.requestBuffer.GetAccountWithBackpressure(ctx, accountID)
|
account, err := am.requestBuffer.GetAccountWithBackpressure(ctx, accountID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, nil, nil, err
|
return nil, nil, nil, err
|
||||||
|
Loading…
Reference in New Issue
Block a user