contact retry handle engine shutdown better
continuous-integration/drone/pr Build is passing Details

This commit is contained in:
Dan Ballard 2022-12-13 16:13:37 -08:00
parent 4e2000cae4
commit 3bb2b0988e
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 {