(w http.ResponseWriter, r *http.Request)
| 128 | } |
| 129 | |
| 130 | func shutDownHandler(w http.ResponseWriter, r *http.Request) { |
| 131 | gqlReq := &schema.Request{ |
| 132 | Query: ` |
| 133 | mutation { |
| 134 | shutdown { |
| 135 | response { |
| 136 | code |
| 137 | } |
| 138 | } |
| 139 | }`, |
| 140 | } |
| 141 | |
| 142 | if resp := resolveWithAdminServer(gqlReq, r, adminServer); len(resp.Errors) != 0 { |
| 143 | x.SetStatus(w, resp.Errors[0].Message, "Shutdown failed.") |
| 144 | return |
| 145 | } |
| 146 | w.Header().Set("Content-Type", "application/json") |
| 147 | x.Check2(w.Write([]byte(`{"code": "Success", "message": "Server is shutting down"}`))) |
| 148 | } |
| 149 | |
| 150 | func memoryLimitHandler(w http.ResponseWriter, r *http.Request) { |
| 151 | switch r.Method { |
nothing calls this directly
no test coverage detected