mirror of
https://code.forgejo.org/forgejo/runner.git
synced 2025-09-15 18:57:01 +00:00
feat: cache-server: shutdown on TERM
in the same way the daemon can be shutdown by either INT or TERM the cache server could only be shutdown with INT
This commit is contained in:
parent
39dd708768
commit
98552f9b99
1 changed files with 2 additions and 1 deletions
|
@ -8,6 +8,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"os/signal"
|
"os/signal"
|
||||||
|
"syscall"
|
||||||
|
|
||||||
"code.forgejo.org/forgejo/runner/v11/internal/pkg/config"
|
"code.forgejo.org/forgejo/runner/v11/internal/pkg/config"
|
||||||
|
|
||||||
|
@ -73,7 +74,7 @@ func runCacheServer(ctx context.Context, configFile *string, cacheArgs *cacheSer
|
||||||
log.Infof("cache server is listening on %v", cacheHandler.ExternalURL())
|
log.Infof("cache server is listening on %v", cacheHandler.ExternalURL())
|
||||||
|
|
||||||
c := make(chan os.Signal, 1)
|
c := make(chan os.Signal, 1)
|
||||||
signal.Notify(c, os.Interrupt)
|
signal.Notify(c, syscall.SIGINT, syscall.SIGTERM)
|
||||||
<-c
|
<-c
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue