Review and fix some usages of Future.cancel; Bump Chronos
This commit is contained in:
parent
9c5cef346b
commit
ebfacf597c
|
@ -404,7 +404,7 @@ proc init*(T: type Eth1Monitor,
|
||||||
let web3Fut = newWeb3(web3Url)
|
let web3Fut = newWeb3(web3Url)
|
||||||
yield web3Fut or sleepAsync(chronos.seconds(5))
|
yield web3Fut or sleepAsync(chronos.seconds(5))
|
||||||
if (not web3Fut.finished) or web3Fut.failed:
|
if (not web3Fut.finished) or web3Fut.failed:
|
||||||
web3Fut.cancel()
|
await cancelAndWait(web3Fut)
|
||||||
return err "Failed to setup web3 connection"
|
return err "Failed to setup web3 connection"
|
||||||
|
|
||||||
let
|
let
|
||||||
|
|
|
@ -789,13 +789,10 @@ proc dialPeer*(node: Eth2Node, peerAddr: PeerAddr, index = 0) {.async.} =
|
||||||
deadline.cancel()
|
deadline.cancel()
|
||||||
inc nbc_successful_dials
|
inc nbc_successful_dials
|
||||||
else:
|
else:
|
||||||
# TODO(cheatfate): As soon as `nim-libp2p` will be able to handle cancellation
|
|
||||||
# properly and will have cancellation tests, we need add here cancellation
|
|
||||||
# of `workfut`.
|
|
||||||
# workfut.cancel()
|
|
||||||
debug "Connection to remote peer timed out"
|
debug "Connection to remote peer timed out"
|
||||||
inc nbc_timeout_dials
|
inc nbc_timeout_dials
|
||||||
node.addSeen(peerAddr.peerId, SeenTableTimeTimeout)
|
node.addSeen(peerAddr.peerId, SeenTableTimeTimeout)
|
||||||
|
await cancelAndWait(workfut)
|
||||||
except CatchableError as exc:
|
except CatchableError as exc:
|
||||||
debug "Connection to remote peer failed", msg = exc.msg
|
debug "Connection to remote peer failed", msg = exc.msg
|
||||||
inc nbc_failed_dials
|
inc nbc_failed_dials
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 710454cc6b792748144882d7c97912b0c6cef138
|
Subproject commit 879c917242ab2af0a8332669f92987cd1e40370f
|
Loading…
Reference in New Issue