remove semaphore and fix push metrics

This commit is contained in:
Pascal Fischer
2025-10-08 21:03:15 +02:00
parent 26f5aee4b9
commit fc2f23bd22
2 changed files with 3 additions and 7 deletions

View File

@@ -1264,7 +1264,6 @@ func (am *DefaultAccountManager) UpdateAccountPeers(ctx context.Context, account
}
var wg sync.WaitGroup
semaphore := make(chan struct{}, 10)
dnsCache := &DNSConfigCache{}
dnsDomain := am.GetDNSDomain(account.Settings)
@@ -1297,10 +1296,8 @@ func (am *DefaultAccountManager) UpdateAccountPeers(ctx context.Context, account
}
wg.Add(1)
semaphore <- struct{}{}
go func(p *nbpeer.Peer) {
defer wg.Done()
defer func() { <-semaphore }()
start := time.Now()
@@ -1339,8 +1336,6 @@ func (am *DefaultAccountManager) UpdateAccountPeers(ctx context.Context, account
}(peer)
}
//
wg.Wait()
if am.metrics != nil {
am.metrics.AccountManagerMetrics().CountUpdateAccountPeersDuration(time.Since(globalStart))