Cpu resources (#642)

* fn: cpu quota implementation
This commit is contained in:
Tolga Ceylan
2018-01-12 11:38:28 -08:00
committed by GitHub
parent fa59400a97
commit 39b2cb2d9b
29 changed files with 856 additions and 91 deletions

View File

@@ -17,7 +17,11 @@ func (s *Server) handleRunnerEnqueue(c *gin.Context) {
var call models.Call
err := c.BindJSON(&call)
if err != nil {
handleErrorResponse(c, models.ErrInvalidJSON)
if models.IsAPIError(err) {
handleErrorResponse(c, err)
} else {
handleErrorResponse(c, models.ErrInvalidJSON)
}
return
}
@@ -92,7 +96,11 @@ func (s *Server) handleRunnerStart(c *gin.Context) {
var call models.Call
err := c.BindJSON(&call)
if err != nil {
handleErrorResponse(c, models.ErrInvalidJSON)
if models.IsAPIError(err) {
handleErrorResponse(c, err)
} else {
handleErrorResponse(c, models.ErrInvalidJSON)
}
return
}
@@ -143,7 +151,11 @@ func (s *Server) handleRunnerFinish(c *gin.Context) {
}
err := c.BindJSON(&body)
if err != nil {
handleErrorResponse(c, models.ErrInvalidJSON)
if models.IsAPIError(err) {
handleErrorResponse(c, err)
} else {
handleErrorResponse(c, models.ErrInvalidJSON)
}
return
}