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

Method CoolDownHandler

pkg/funclet/handler.go:188–206  ·  view source on GitHub ↗
(c *server.Context)

Source from the content-addressed store, hash-verified

186}
187
188func (f *Funclet) CoolDownHandler(c *server.Context) {
189 response := c.Response()
190 logger := c.Logger()
191
192 params := api.ResetRequest{}
193 if err := c.Request().ReadEntity(&params); err != nil {
194 c.WithWarnLog(err).WriteTo(response)
195 return
196 }
197 logger.V(6).Infof("cool down container %s start", params.ContainerID)
198 defer logger.TimeTrack(time.Now(), "cool down container finish")
199 fCtx := f.NewContext(c.RequestID(), logger)
200 err, res := f.ResetContainerEvent(fCtx, &params)
201 if err != nil {
202 c.WithErrorLog(err).WriteTo(response)
203 return
204 }
205 response.WriteHeaderAndEntity(http.StatusOK, res)
206}
207
208func (f *Funclet) RebornHandler(c *server.Context) {
209 response := c.Response()

Callers

nothing calls this directly

Calls 12

NewContextMethod · 0.95
ResetContainerEventMethod · 0.95
ResponseMethod · 0.80
LoggerMethod · 0.80
RequestMethod · 0.80
WriteToMethod · 0.80
InfofMethod · 0.80
VMethod · 0.80
TimeTrackMethod · 0.80
RequestIDMethod · 0.80
WithWarnLogMethod · 0.45
WithErrorLogMethod · 0.45

Tested by

no test coverage detected