MCPcopy
hub / github.com/cortexlabs/cortex / Awaken

Method Awaken

pkg/autoscaler/handler.go:36–51  ·  view source on GitHub ↗
(w http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

34}
35
36func (h *Handler) Awaken(w http.ResponseWriter, r *http.Request) {
37 var api userconfig.Resource
38 if err := json.NewDecoder(r.Body).Decode(&api); err != nil {
39 http.Error(w, "failed to json decode request body", http.StatusBadRequest)
40 return
41 }
42 defer func() { _ = r.Body.Close() }()
43
44 if err := h.autoscaler.Awaken(api); err != nil {
45 http.Error(w, errors.Wrap(err, "failed to awaken api").Error(), http.StatusInternalServerError)
46 telemetry.Error(err)
47 return
48 }
49
50 w.WriteHeader(http.StatusOK)
51}

Callers

nothing calls this directly

Calls 4

WrapFunction · 0.92
ErrorFunction · 0.92
ErrorMethod · 0.80
AwakenMethod · 0.65

Tested by

no test coverage detected