mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-12-23 00:46:30 +00:00
Fix channel buffer used with signal.Notify (#421)
Co-authored-by: Anbraten <anton@ju60.de>
This commit is contained in:
parent
01ebbd8c2d
commit
7913d6db95
2 changed files with 2 additions and 2 deletions
|
@ -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 a new issue