MCPcopy Index your code
hub / github.com/aptly-dev/aptly / apiTasksWaitForTaskByID

Function apiTasksWaitForTaskByID

api/task.go:54–69  ·  view source on GitHub ↗

@Summary Wait for Task @Description **Waits for and returns when given Task ID is complete** @Tags Tasks @Produce json @Param id path int true "Task ID" @Success 200 {object} task.Task @Failure 500 {object} Error "invalid syntax, bad id?" @Failure 400 {object} Error "Task Not Found" @Router /api/tas

(c *gin.Context)

Source from the content-addressed store, hash-verified

52// @Failure 400 {object} Error "Task Not Found"
53// @Router /api/tasks/{id}/wait [get]
54func apiTasksWaitForTaskByID(c *gin.Context) {
55 list := context.TaskList()
56 id, err := strconv.ParseInt(c.Params.ByName("id"), 10, 0)
57 if err != nil {
58 AbortWithJSONError(c, 500, err)
59 return
60 }
61
62 task, err := list.WaitForTaskByID(int(id))
63 if err != nil {
64 AbortWithJSONError(c, 400, err)
65 return
66 }
67
68 c.JSON(200, task)
69}
70
71// @Summary Get Task Info
72// @Description **Return task information for a given ID**

Callers

nothing calls this directly

Calls 4

AbortWithJSONErrorFunction · 0.85
TaskListMethod · 0.80
WaitForTaskByIDMethod · 0.80
ByNameMethod · 0.45

Tested by

no test coverage detected