Compare commits

...

1 Commits

Author SHA1 Message Date
crn4
a69dc29e7e add log for getaccount by peer pub key 2025-09-17 14:05:55 +02:00

View File

@@ -928,6 +928,10 @@ func (s *SqlStore) GetAnyAccountID(ctx context.Context) (string, error) {
func (s *SqlStore) GetAccountIDByPeerPubKey(ctx context.Context, peerKey string) (string, error) {
var peer nbpeer.Peer
var accountID string
start := time.Now()
defer func() {
log.WithContext(ctx).Tracef("GetAccountIDByPeerPubKey for peerPubKey %s and accountId %s took %v", peerKey, accountID, time.Since(start))
}()
result := s.db.Model(&peer).Select("account_id").Where(GetKeyQueryCondition(s), peerKey).Take(&accountID)
if result.Error != nil {
if errors.Is(result.Error, gorm.ErrRecordNotFound) {