Skip to content

Commit

Permalink
fix: stop chain-sync client in bulk mode in test program (#598)
Browse files Browse the repository at this point in the history
  • Loading branch information
agaffney committed Apr 25, 2024
1 parent df1a18b commit 62885c9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/gouroboros/chainsync.go
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,11 @@ func testChainSync(f *globalFlags) {
fmt.Printf("ERROR: failed to get available block range: %s\n", err)
os.Exit(1)
}
// Stop the chain-sync client to prevent the connection getting closed due to chain-sync idle timeout
if err := oConn.ChainSync().Client.Stop(); err != nil {
fmt.Printf("ERROR: failed to shutdown chain-sync: %s\n", err)
os.Exit(1)
}
if err := oConn.BlockFetch().Client.GetBlockRange(start, end); err != nil {
fmt.Printf("ERROR: failed to request block range: %s\n", err)
os.Exit(1)
Expand Down

0 comments on commit 62885c9

Please sign in to comment.