mirror of
https://github.com/netbirdio/netbird.git
synced 2025-06-19 08:17:01 +02: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()
|
unlock := am.Store.AcquireGlobalLock()
|
||||||
defer unlock()
|
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
|
// We checked if the domain has a primary account already
|
||||||
domainAccount, err := am.Store.GetAccountByPrivateDomain(claims.Domain)
|
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
|
// 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) {
|
func (am *DefaultAccountManager) GetOrCreateAccountByUser(userID, domain string) (*Account, error) {
|
||||||
|
start := time.Now()
|
||||||
unlock := am.Store.AcquireGlobalLock()
|
unlock := am.Store.AcquireGlobalLock()
|
||||||
defer unlock()
|
defer unlock()
|
||||||
|
log.Debugf("Acquired global lock in %s for user %s", time.Since(start), userID)
|
||||||
|
|
||||||
lowerDomain := strings.ToLower(domain)
|
lowerDomain := strings.ToLower(domain)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user