mirror of
https://github.com/status-im/nimbus-eth2.git
synced 2025-02-18 17:37:33 +00:00
Eth2Node.stop(): 5s timeout
This commit is contained in:
parent
e4173860f0
commit
b2193f1b8f
@ -720,11 +720,14 @@ proc start*(node: Eth2Node) {.async.} =
|
||||
traceAsyncErrors node.discoveryLoop
|
||||
|
||||
proc stop*(node: Eth2Node) {.async.} =
|
||||
# ignore errors in futures, since we're shutting down
|
||||
await allFutures(@[
|
||||
# Ignore errors in futures, since we're shutting down.
|
||||
# Use a timer to avoid hangups.
|
||||
discard await one(sleepAsync(5.seconds),
|
||||
allFutures(@[
|
||||
node.discovery.closeWait(),
|
||||
node.switch.stop(),
|
||||
])
|
||||
)
|
||||
|
||||
proc init*(T: type Peer, network: Eth2Node, info: PeerInfo): Peer =
|
||||
new result
|
||||
|
Loading…
x
Reference in New Issue
Block a user