MCPcopy Create free account
hub / github.com/baidu/EasyFaaS / InvalidateRuntime

Method InvalidateRuntime

pkg/controller/handler.go:153–169  ·  view source on GitHub ↗
(c *routing.Context)

Source from the content-addressed store, hash-verified

151}
152
153func (controller *Controller) InvalidateRuntime(c *routing.Context) error {
154 runtimeID := c.Param("runtimeID")
155 runtime, err := controller.runtimeDispatcher.GetRuntime(runtimeID)
156 if err != nil {
157 c.Response.SetStatusCode(http.StatusNotFound)
158 c.Response.AppendBodyString("can not find runtime " + runtimeID)
159 }
160
161 if runtime == nil {
162 c.Response.SetStatusCode(http.StatusNotFound)
163 c.Response.AppendBodyString("can not find runtime " + runtimeID)
164 return nil
165 }
166 logs.Infof("invalidate runtime %d manually", runtimeID)
167 runtime.Invalidate()
168 return nil
169}
170
171func generateInvokeRequest(c *routing.Context) *api.InvokeProxyRequest {
172 hMap := make(map[string]string)

Callers

nothing calls this directly

Calls 5

InfofFunction · 0.92
ParamMethod · 0.80
InvalidateMethod · 0.80
GetRuntimeMethod · 0.65
SetStatusCodeMethod · 0.45

Tested by

no test coverage detected