Skip to content

Commit 62885c9

Browse files
authored
fix: stop chain-sync client in bulk mode in test program (#598)
1 parent df1a18b commit 62885c9

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

cmd/gouroboros/chainsync.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,11 @@ func testChainSync(f *globalFlags) {
247247
fmt.Printf("ERROR: failed to get available block range: %s\n", err)
248248
os.Exit(1)
249249
}
250+
// Stop the chain-sync client to prevent the connection getting closed due to chain-sync idle timeout
251+
if err := oConn.ChainSync().Client.Stop(); err != nil {
252+
fmt.Printf("ERROR: failed to shutdown chain-sync: %s\n", err)
253+
os.Exit(1)
254+
}
250255
if err := oConn.BlockFetch().Client.GetBlockRange(start, end); err != nil {
251256
fmt.Printf("ERROR: failed to request block range: %s\n", err)
252257
os.Exit(1)

0 commit comments

Comments
 (0)