MCPcopy Create free account
hub / github.com/GoogleCloudPlatform/cloud-sql-proxy / quitquitquit

Function quitquitquit

cmd/root.go:1261–1276  ·  view source on GitHub ↗
(quitOnce *sync.Once, shutdownCh chan<- error)

Source from the content-addressed store, hash-verified

1259}
1260
1261func quitquitquit(quitOnce *sync.Once, shutdownCh chan<- error) http.HandlerFunc {
1262 return func(rw http.ResponseWriter, req *http.Request) {
1263 if req.Method != http.MethodPost && req.Method != http.MethodGet {
1264 rw.WriteHeader(400)
1265 return
1266 }
1267 quitOnce.Do(func() {
1268 select {
1269 case shutdownCh <- errQuitQuitQuit:
1270 default:
1271 // The write attempt to shutdownCh failed and
1272 // the proxy is already exiting.
1273 }
1274 })
1275 }
1276}
1277
1278func startHTTPServer(ctx context.Context, l cloudsql.Logger, addr string, mux *http.ServeMux, shutdownCh chan<- error) {
1279 server := &http.Server{

Callers 1

runSignalWrapperFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected