File tree 2 files changed +4
-5
lines changed
2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -124,8 +124,8 @@ func main() {
124
124
125
125
ex := executor .NewExecutor (executor.ExecutorArgs {
126
126
Logger : logger ,
127
- Command : func (context.Context ) * exec.Cmd {
128
- cmd := exec .Command ( execCmd , execArgs ... )
127
+ Command : func (ctx context.Context ) * exec.Cmd {
128
+ cmd := exec .CommandContext ( ctx , execCmd , execArgs ... )
129
129
cmd .Stdout = os .Stdout
130
130
cmd .Stderr = os .Stderr
131
131
cmd .Stdin = os .Stdin
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ type ExecutorArgs struct {
27
27
28
28
func NewExecutor (args ExecutorArgs ) * Executor {
29
29
done := make (chan os.Signal , 1 )
30
- signal .Notify (done , syscall .SIGTERM )
30
+ signal .Notify (done , syscall .SIGINT , syscall . SIGTERM )
31
31
32
32
if args .Logger == nil {
33
33
args .Logger = slog .Default ()
@@ -51,8 +51,6 @@ func (ex *Executor) Exec() error {
51
51
ex .mu .Unlock ()
52
52
}()
53
53
54
- ex .logger .Debug ("[exec] starting process" )
55
-
56
54
ctx , cf := context .WithCancel (context .TODO ())
57
55
defer cf ()
58
56
@@ -82,6 +80,7 @@ func (ex *Executor) Exec() error {
82
80
}
83
81
}()
84
82
83
+ ex .logger .Debug ("[exec:post] process running" )
85
84
if err := cmd .Wait (); err != nil {
86
85
if strings .HasPrefix (err .Error (), "signal:" ) {
87
86
ex .logger .Debug ("wait terminated, received" , "signal" , err .Error ())
You can’t perform that action at this time.
0 commit comments