Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
Bo-Yi Wu
2022-07-12 17:37:48 +08:00
committed by Jason Song
parent db7ee2eaf4
commit 08282a519f
2 changed files with 11 additions and 19 deletions

View File

@ -4,6 +4,7 @@ import (
"context"
"os"
"os/signal"
"syscall"
"gitea.com/gitea/act_runner/cmd"
)
@ -14,7 +15,7 @@ func main() {
// trap Ctrl+C and call cancel on the context
c := make(chan os.Signal, 1)
signal.Notify(c, os.Interrupt)
signal.Notify(c, syscall.SIGINT, syscall.SIGTERM)
defer func() {
signal.Stop(c)
cancel()