mirror of
https://github.com/status-im/nim-libp2p.git
synced 2025-02-16 14:58:11 +00:00
fix: stop services after transports
This commit is contained in:
parent
100f3188ed
commit
5b154c30a4
@ -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"
|
||||
|
Loading…
x
Reference in New Issue
Block a user