From 3bb2b0988e5a488ba2a8711bf06de6056322ec6d Mon Sep 17 00:00:00 2001 From: Dan Ballard Date: Tue, 13 Dec 2022 16:13:37 -0800 Subject: [PATCH] contact retry handle engine shutdown better --- app/plugins/contactRetry.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/plugins/contactRetry.go b/app/plugins/contactRetry.go index 23f0609..34e2cab 100644 --- a/app/plugins/contactRetry.go +++ b/app/plugins/contactRetry.go @@ -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 {