mirror of
https://github.com/netbirdio/netbird.git
synced 2026-05-06 17:08:53 +00:00
[management] Get account id with order (#3773)
updated log to display account id
This commit is contained in:
@@ -721,7 +721,7 @@ func (am *DefaultAccountManager) loadAccount(ctx context.Context, accountID any)
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, nil, err
|
return nil, nil, err
|
||||||
}
|
}
|
||||||
log.WithContext(ctx).Debugf("%d entries received from IdP management", len(userData))
|
log.WithContext(ctx).Debugf("%d entries received from IdP management for account %s", len(userData), account.Id)
|
||||||
|
|
||||||
dataMap := make(map[string]*idp.UserData, len(userData))
|
dataMap := make(map[string]*idp.UserData, len(userData))
|
||||||
for _, datum := range userData {
|
for _, datum := range userData {
|
||||||
|
|||||||
@@ -802,7 +802,7 @@ func (s *SqlStore) GetAccountByPeerPubKey(ctx context.Context, peerKey string) (
|
|||||||
|
|
||||||
func (s *SqlStore) GetAnyAccountID(ctx context.Context) (string, error) {
|
func (s *SqlStore) GetAnyAccountID(ctx context.Context) (string, error) {
|
||||||
var account types.Account
|
var account types.Account
|
||||||
result := s.db.WithContext(ctx).Select("id").Limit(1).Find(&account)
|
result := s.db.WithContext(ctx).Select("id").Order("created_at desc").Limit(1).Find(&account)
|
||||||
if result.Error != nil {
|
if result.Error != nil {
|
||||||
return "", status.NewGetAccountFromStoreError(result.Error)
|
return "", status.NewGetAccountFromStoreError(result.Error)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user