contact retry handle engine shutdown better #484

Merged
sarah merged 2 commits from contactRetryDisconn into master 2022-12-14 18:52:12 +00:00
1 changed files with 11 additions and 0 deletions

View File

@ -255,6 +255,17 @@ func (cr *contactRetry) run() {
case event.ProtocolEngineShutdown:
cr.ACNUp = false
cr.protocolEngine = false
cr.connections.Range(func(k, v interface{}) bool {
p := v.(*contact)
if p.state == connections.AUTHENTICATED || p.state == connections.SYNCED {
p.lastSeen = time.Now()
}
p.state = connections.DISCONNECTED
p.failedCount = 0
return true
})
case event.ACNStatus:
prog := e.Data[event.Progress]
if !cr.protocolEngine {