MCPcopy Index your code
hub / github.com/dgraph-io/dgraph / shutDownHandler

Function shutDownHandler

dgraph/cmd/alpha/admin.go:130–148  ·  view source on GitHub ↗
(w http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

128}
129
130func 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
150func memoryLimitHandler(w http.ResponseWriter, r *http.Request) {
151 switch r.Method {

Callers

nothing calls this directly

Calls 5

SetStatusFunction · 0.92
Check2Function · 0.92
resolveWithAdminServerFunction · 0.85
SetMethod · 0.65
WriteMethod · 0.65

Tested by

no test coverage detected