mirror of
https://github.com/logos-messaging/logos-messaging-nim.git
synced 2026-02-13 18:33:26 +00:00
canary exits with error if ping fails (#3711)
This commit is contained in:
parent
a8bdbca98a
commit
dd8dc7429d
@ -278,6 +278,10 @@ proc main(rng: ref HmacDrbgContext): Future[int] {.async.} =
|
||||
pingSuccess = false
|
||||
error "Ping operation failed or timed out", error = exc.msg
|
||||
|
||||
if not pingSuccess:
|
||||
error "Ping to the node failed", peerId = peer.peerId, conStatus = $conStatus
|
||||
quit(QuitFailure)
|
||||
|
||||
if conStatus in [Connected, CanConnect]:
|
||||
let nodeProtocols = lp2pPeerStore[ProtoBook][peer.peerId]
|
||||
|
||||
@ -285,11 +289,6 @@ proc main(rng: ref HmacDrbgContext): Future[int] {.async.} =
|
||||
error "Not all protocols are supported",
|
||||
expected = conf.protocols, supported = nodeProtocols
|
||||
quit(QuitFailure)
|
||||
|
||||
# Check ping result if ping was enabled
|
||||
if conf.ping and not pingSuccess:
|
||||
error "Node is reachable and supports protocols but ping failed - connection may be unstable"
|
||||
quit(QuitFailure)
|
||||
elif conStatus == CannotConnect:
|
||||
error "Could not connect", peerId = peer.peerId
|
||||
quit(QuitFailure)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user