cli: add graceful catches to SIGINT (#8308)

This commit is contained in:
Callum Waters
2022-04-12 01:20:43 +12:00
committed by GitHub
parent 0ab2f31239
commit b7e87eef05
2 changed files with 2 additions and 2 deletions

View File

@@ -180,7 +180,7 @@ for applications built w/ Cosmos SDK).
return err
}
ctx, cancel := signal.NotifyContext(cmd.Context(), syscall.SIGTERM)
ctx, cancel := signal.NotifyContext(cmd.Context(), os.Interrupt, syscall.SIGTERM)
defer cancel()
go func() {

View File

@@ -105,7 +105,7 @@ func NewRunNodeCmd(nodeProvider cfg.ServiceProvider, conf *cfg.Config, logger lo
return err
}
ctx, cancel := signal.NotifyContext(cmd.Context(), syscall.SIGTERM)
ctx, cancel := signal.NotifyContext(cmd.Context(), os.Interrupt, syscall.SIGTERM)
defer cancel()
n, err := nodeProvider(ctx, conf, logger)