fix: stop services after transports

This commit is contained in:
Diego 2024-06-25 13:50:08 +02:00
parent 100f3188ed
commit 5b154c30a4
No known key found for this signature in database
GPG Key ID: C9DAC9BF68D1F806

View File

@ -284,9 +284,6 @@ proc stop*(s: Switch) {.async, public.} =
except CatchableError as exc:
debug "Cannot cancel accepts", error = exc.msg
for service in s.services:
discard await service.stop(s)
# close and cleanup all connections
await s.connManager.close()
@ -298,6 +295,9 @@ proc stop*(s: Switch) {.async, public.} =
except CatchableError as exc:
warn "error cleaning up transports", msg = exc.msg
for service in s.services:
discard await service.stop(s)
await s.ms.stop()
trace "Switch stopped"