Move log msg

This commit is contained in:
Viktor Liu 2025-06-12 15:15:55 +02:00
parent c6a3a3887c
commit 6ca48712e3

View File

@ -553,8 +553,6 @@ func (m *Manager) onPeerInactivityTimedOut(ctx context.Context, peerConnID peeri
return
}
mp.peerCfg.Log.Infof("connection timed out")
if m.shouldDeferIdleForHA(mp.peerCfg.PublicKey) {
iw, ok := m.inactivityMonitors[peerConnID]
if ok {
@ -566,6 +564,8 @@ func (m *Manager) onPeerInactivityTimedOut(ctx context.Context, peerConnID peeri
return
}
mp.peerCfg.Log.Infof("connection timed out")
// this is blocking operation, potentially can be optimized
m.peerStore.PeerConnClose(mp.peerCfg.PublicKey)