Skip to content

Commit b7b2975

Browse files
committed
handle ctrl-c and kill signals
1 parent 76d2fae commit b7b2975

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

cmd/s3backup/main.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"os/signal"
1010
"runtime/debug"
1111
"slices"
12+
"syscall"
1213

1314
"github.com/AlecAivazis/survey/v2"
1415
"github.com/urfave/cli-altsrc/v3"
@@ -153,7 +154,7 @@ func main() {
153154
},
154155
}
155156

156-
ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt)
157+
ctx, stop := signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM)
157158
defer stop()
158159

159160
if err := app.Run(ctx, os.Args); err != nil {

0 commit comments

Comments
 (0)