mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-05-09 16:56:55 +00:00
Co-authored-by: Masaya Watanabe <sfbgwm30@gmail.com>
This commit is contained in:
parent
8368a17b06
commit
9c208c1ab0
@ -26,7 +26,7 @@ func WithContext(ctx context.Context) context.Context {
|
||||
func WithContextFunc(ctx context.Context, f func()) context.Context {
|
||||
ctx, cancel := context.WithCancel(ctx)
|
||||
go func() {
|
||||
c := make(chan os.Signal)
|
||||
c := make(chan os.Signal, 1)
|
||||
signal.Notify(c, syscall.SIGINT, syscall.SIGTERM)
|
||||
defer signal.Stop(c)
|
||||
|
||||
|
@ -20,7 +20,7 @@ func WithContext(ctx context.Context) context.Context {
|
||||
func WithContextFunc(ctx context.Context, f func()) context.Context {
|
||||
ctx, cancel := context.WithCancel(ctx)
|
||||
go func() {
|
||||
c := make(chan os.Signal)
|
||||
c := make(chan os.Signal, 1)
|
||||
signal.Notify(c, os.Interrupt)
|
||||
defer signal.Stop(c)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user