mirror of
https://github.com/netbirdio/netbird.git
synced 2024-11-21 23:53:14 +01:00
Log global lock acquisition per user (#2039)
This commit is contained in:
parent
6b01b0020e
commit
29a2d93873
@ -1788,8 +1788,10 @@ func (am *DefaultAccountManager) getAccountWithAuthorizationClaims(claims jwtcla
|
||||
}
|
||||
}
|
||||
|
||||
start := time.Now()
|
||||
unlock := am.Store.AcquireGlobalLock()
|
||||
defer unlock()
|
||||
log.Debugf("Acquired global lock in %s for user %s", time.Since(start), claims.UserId)
|
||||
|
||||
// We checked if the domain has a primary account already
|
||||
domainAccount, err := am.Store.GetAccountByPrivateDomain(claims.Domain)
|
||||
|
@ -910,8 +910,10 @@ func (am *DefaultAccountManager) SaveOrAddUser(accountID, initiatorUserID string
|
||||
|
||||
// GetOrCreateAccountByUser returns an existing account for a given user id or creates a new one if doesn't exist
|
||||
func (am *DefaultAccountManager) GetOrCreateAccountByUser(userID, domain string) (*Account, error) {
|
||||
start := time.Now()
|
||||
unlock := am.Store.AcquireGlobalLock()
|
||||
defer unlock()
|
||||
log.Debugf("Acquired global lock in %s for user %s", time.Since(start), userID)
|
||||
|
||||
lowerDomain := strings.ToLower(domain)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user