@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)
| 52 | // @Failure 400 {object} Error "Task Not Found" |
| 53 | // @Router /api/tasks/{id}/wait [get] |
| 54 | func 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** |
nothing calls this directly
no test coverage detected