mirror of
https://code.forgejo.org/forgejo/runner.git
synced 2025-06-27 16:35:58 +00:00
stash
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
parent
db7ee2eaf4
commit
08282a519f
2 changed files with 11 additions and 19 deletions
3
main.go
3
main.go
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue