Skip to content

Commit

Permalink
fix Close() bug; we only have a single Subscription to cancel
Browse files Browse the repository at this point in the history
  • Loading branch information
Joe Bowman committed Apr 17, 2024
1 parent 3655284 commit 7bf97d2
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions icq-relayer/pkg/runner/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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())
}

0 comments on commit 7bf97d2

Please sign in to comment.