Skip to content

Commit

Permalink
fix: peer gc
Browse files Browse the repository at this point in the history
Signed-off-by: Gaius <[email protected]>
  • Loading branch information
gaius-qi committed Dec 10, 2021
1 parent 1e62cc4 commit 258bf04
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion manager/console
Submodule console updated 1 files
+2 −2 src/global.css
3 changes: 2 additions & 1 deletion scheduler/supervisor/peer.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,9 @@ func (m *peerManager) RunGC() error {
peer := value.(*Peer)
elapsed := time.Since(peer.lastAccessAt.Load())

if elapsed > m.peerTTI && !peer.IsDone() && !peer.Host.IsCDN {
if elapsed > m.peerTTI && !peer.IsDone() && !peer.Host.IsCDN && peer.GetStatus() != PeerStatusZombie {
if !peer.IsConnected() {
peer.Log().Infof("peer is not connected")
peer.Leave()
}
peer.Log().Infof("peer has been more than %s since last access, it's status changes from %s to zombie", m.peerTTI, peer.GetStatus().String())
Expand Down

0 comments on commit 258bf04

Please sign in to comment.