File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 8989 httpGet :
9090 path : /ping
9191 port : http
92+ {{- if .Values.tls.enabled }}
93+ scheme : HTTPS
94+ {{- end }}
9295 initialDelaySeconds : 10
9396 periodSeconds : 10
9497 timeoutSeconds : 5
97100 httpGet :
98101 path : /health
99102 port : http
103+ {{- if .Values.tls.enabled }}
104+ scheme : HTTPS
105+ {{- end }}
100106 initialDelaySeconds : 5
101107 periodSeconds : 5
102108 timeoutSeconds : 3
Original file line number Diff line number Diff line change 44 "context"
55 "fmt"
66 "net/http"
7+ "time"
78
89 "github.com/gin-gonic/gin"
910 "github.com/kevingruber/gradle-cache/internal/config"
@@ -159,7 +160,15 @@ func (s *Server) Run(ctx context.Context) error {
159160 select {
160161 case <- ctx .Done ():
161162 s .logger .Info ().Msg ("shutting down server" )
162- return srv .Shutdown (context .Background ())
163+
164+ shutdownCtx , cancel := context .WithTimeout (context .Background (), 10 * time .Second )
165+ defer cancel ()
166+
167+ if err := srv .Shutdown (shutdownCtx ); err != nil {
168+ return fmt .Errorf ("server shutdown failed %w" , err )
169+
170+ }
171+ return nil
163172 case err := <- errCh :
164173 return err
165174 }
You can’t perform that action at this time.
0 commit comments