[#1170] ir, node: Stop the app on WS connection lost

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
Pavel Karpy 2022-03-31 15:46:28 +03:00 committed by Alex Vanin
parent 2427593da6
commit 6508136204
3 changed files with 11 additions and 5 deletions

View file

@ -47,6 +47,9 @@ func initMorphComponents(c *cfg) {
client.WithDialTimeout(morphconfig.DialTimeout(c.appCfg)),
client.WithLogger(c.log),
client.WithExtraEndpoints(addresses[1:]),
client.WithConnLostCallback(func() {
c.internalErr <- errors.New("morph connection has been lost")
}),
)
if err != nil {
c.log.Info("failed to create neo RPC client",