From 0957defa5481e36e55135a216f763211601fea37 Mon Sep 17 00:00:00 2001 From: crn4 Date: Wed, 9 Jul 2025 15:34:33 +0200 Subject: [PATCH] some logs over buffer update --- management/server/peer.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/management/server/peer.go b/management/server/peer.go index 2ddd75c67..5c22e1f18 100644 --- a/management/server/peer.go +++ b/management/server/peer.go @@ -1261,14 +1261,20 @@ func (am *DefaultAccountManager) BufferUpdateAccountPeers(ctx context.Context, a mu, _ := am.accountUpdateLocks.LoadOrStore(accountID, &sync.Mutex{}) lock := mu.(*sync.Mutex) + log.WithContext(ctx).Debugf("try to BufferUpdateAccountPeers for account %s", accountID) + if !lock.TryLock() { + log.WithContext(ctx).Debugf("BufferUpdateAccountPeers for an account %s locked - returning", accountID) return } go func() { time.Sleep(time.Duration(am.updateAccountPeersBufferInterval.Load())) lock.Unlock() + log.WithContext(ctx).Debugf("BufferUpdateAccountPeers for an account %s - in progress", accountID) + tn := time.Now() am.UpdateAccountPeers(ctx, accountID) + log.WithContext(ctx).Debugf("BufferUpdateAccountPeers for an account %s - took %dms", accountID, time.Since(tn).Milliseconds()) }() }