You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, the Go 1.20 release added WaitDelay and Cancel properties to Cmd. These new features along with https://pkg.go.dev/os/exec#CommandContext can be used to simplify the termination logic for captive core (see golang/go@49abdbc for an example of how to use WaitDelay / Cancel).
The text was updated successfully, but these errors were encountered:
tamirms
changed the title
Use Cmd.WaitDelay and Cmd.Cancel to simplify captive core termination
Use Cmd.WaitDelay and Cmd.Cancel with CommandContext to simplify captive core termination
Jun 16, 2024
In #3694 we introduced the following code which attempts to gracefully terminate captive core:
https://github.com/bartekn/go/blob/36251ee7536bd423a66803c0ead9825ccefd084d/ingest/ledgerbackend/stellar_core_runner.go#L357-L404
This code was taken from https://github.com/golang/go/blob/cacac8bdc5c93e7bc71df71981fdf32dded017bf/src/cmd/go/script_test.go#L1091-L1098 .
However, the Go 1.20 release added WaitDelay and Cancel properties to Cmd. These new features along with https://pkg.go.dev/os/exec#CommandContext can be used to simplify the termination logic for captive core (see golang/go@49abdbc for an example of how to use WaitDelay / Cancel).
The text was updated successfully, but these errors were encountered: