Skip to content

Commit

Permalink
fix: interop-node startup bug (#144)
Browse files Browse the repository at this point in the history
  • Loading branch information
devbv authored Apr 1, 2024
1 parent 324e62e commit bd1544e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions tools/interop-node/cmd/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ package cmd
import (
"context"
"fmt"
"os"
"os/signal"
"syscall"

"github.com/tendermint/tendermint/libs/cli/flags"

Expand Down Expand Up @@ -40,6 +43,11 @@ func startCmd() *cobra.Command {
interopServer.Close()
}()

cancelChan := make(chan os.Signal, 1)
signal.Notify(cancelChan, syscall.SIGTERM, syscall.SIGINT)

<-cancelChan

return nil
},
}
Expand Down
2 changes: 1 addition & 1 deletion tools/interop-node/subscriber/ethereum_subscriber.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ func (sub *EthereumSubscriber) dbLoop(ctx context.Context) {

case <-ctx.Done():
close(sub.dbCh)
return
}
}
}
Expand Down Expand Up @@ -235,7 +236,6 @@ func (sub *EthereumSubscriber) fetchLoop(ctx context.Context) {
sub.dbCh <- event
case <-ctx.Done():
sub.logger.Info("fetchLoop stopped")
close(sub.dbCh)
return
}
}
Expand Down

0 comments on commit bd1544e

Please sign in to comment.