mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-11-20 02:56:47 +01:00
lncli: start signal interceptor in getContext
signal Intercept function needs to be called if the signal shutdown channel will be listened on.
This commit is contained in:
@@ -41,6 +41,11 @@ const (
|
||||
)
|
||||
|
||||
func getContext() context.Context {
|
||||
if err := signal.Intercept(); err != nil {
|
||||
_, _ = fmt.Fprintln(os.Stderr, err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
ctxc, cancel := context.WithCancel(context.Background())
|
||||
go func() {
|
||||
<-signal.ShutdownChannel()
|
||||
|
||||
Reference in New Issue
Block a user