INNER CODE UNIT · Go
withShutdownSignal
kaito-project/kaito · cmd/ragengine/main.go:212
func withShutdownSignal(ctx context.Context) context.Context {
signalChan := make(chan os.Signal, 1)
signal.Notify(signalChan, syscall.SIGTERM, syscall.SIGINT, os.Interrupt)
nctx, cancel := context.WithCancel(ctx)
go func() {
<-signalChan
klog.Info("received shutdown signal")
cancel()
}()
return nctx
}
func setRestConfig(c *rest.Config, kubeClientQPS, kubeClientBurst int) {
if kubeClientQPS > 0 {
c.QPS = float32(kubeClientQPS)
}