MCPcopy Index your code
hub / github.com/CovenantSQL/CovenantSQL / cancelTask

Function cancelTask

cmd/cql-proxy/api/task.go:114–136  ·  view source on GitHub ↗
(c *gin.Context)

Source from the content-addressed store, hash-verified

112}
113
114func cancelTask(c *gin.Context) {
115 r := struct {
116 ID int64 `json:"id" form:"id" uri:"id" binding:"required"`
117 }{}
118
119 _ = c.ShouldBindUri(&r)
120
121 if err := c.ShouldBind(&r); err != nil {
122 abortWithError(c, http.StatusBadRequest, err)
123 return
124 }
125
126 developer := getDeveloperID(c)
127 task, err := model.GetTask(model.GetDB(c), developer, r.ID)
128 if err != nil {
129 _ = c.Error(err)
130 abortWithError(c, http.StatusForbidden, ErrGetTaskDetailFailed)
131 return
132 }
133
134 // call task executor to abort
135 getTaskManager(c).Kill(task.ID)
136}

Callers

nothing calls this directly

Calls 7

GetTaskFunction · 0.92
GetDBFunction · 0.92
abortWithErrorFunction · 0.85
getDeveloperIDFunction · 0.85
getTaskManagerFunction · 0.85
ErrorMethod · 0.80
KillMethod · 0.80

Tested by

no test coverage detected