[management] use readlock on add peer (#4308)

This commit is contained in:
Pascal Fischer
2025-08-11 15:21:26 +02:00
committed by GitHub
parent 1022a5015c
commit a942e4add5
4 changed files with 91 additions and 19 deletions

View File

@@ -609,7 +609,7 @@ func (am *DefaultAccountManager) AddPeer(ctx context.Context, setupKey, userID s
newPeer.DNSLabel = freeLabel
newPeer.IP = freeIP
unlock := am.Store.AcquireWriteLockByUID(ctx, accountID)
unlock := am.Store.AcquireReadLockByUID(ctx, accountID)
defer func() {
if unlock != nil {
unlock()