From 7bf97d248dc4188aa28a7b83fa0240313efcac48 Mon Sep 17 00:00:00 2001 From: Joe Bowman Date: Wed, 17 Apr 2024 10:43:03 +0100 Subject: [PATCH] fix Close() bug; we only have a single Subscription to cancel --- icq-relayer/pkg/runner/run.go | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/icq-relayer/pkg/runner/run.go b/icq-relayer/pkg/runner/run.go index 655842858..2cec45095 100644 --- a/icq-relayer/pkg/runner/run.go +++ b/icq-relayer/pkg/runner/run.go @@ -109,7 +109,7 @@ func Run(cfg *config.Config, home string) error { defer func() { err := Close() if err != nil { - logger.Log("worker", "error", "error in Closing the routine") + logger.Log("worker", "init", "msg", "error in closing the routine") } }() for _, c := range cfg.Chains { @@ -828,11 +828,5 @@ func unique(msgSlice []sdk.Msg, logger log.Logger) []sdk.Msg { func Close() error { query := tmquery.MustParse(fmt.Sprintf("message.module='%s'", "interchainquery")) - for _, chainClient := range globalCfg.Cl { - err := chainClient.RPCClient.Unsubscribe(ctx, chainClient.Config.ChainID+"-icq", query.String()) - if err != nil { - return err - } - } - return nil + return globalCfg.Cl[globalCfg.DefaultChain].RPCClient.Unsubscribe(ctx, globalCfg.Cl[globalCfg.DefaultChain].Config.ChainID+"-icq", query.String()) }