1
0
Fork 0
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:
Earl Warren 2025-09-04 16:58:24 +02:00
parent 39dd708768
commit 98552f9b99
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00

View file

@ -8,6 +8,7 @@ import (
"fmt"
"os"
"os/signal"
"syscall"
"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())
c := make(chan os.Signal, 1)
signal.Notify(c, os.Interrupt)
signal.Notify(c, syscall.SIGINT, syscall.SIGTERM)
<-c
return nil