task-dummy: remove internal testing API

This commit is contained in:
André Roth
2024-11-28 15:39:47 +01:00
parent a59fc6b8e8
commit 75e5f95277
3 changed files with 0 additions and 96 deletions
-20
View File
@@ -1,10 +1,8 @@
package api
import (
"net/http"
"strconv"
"github.com/aptly-dev/aptly/aptly"
"github.com/aptly-dev/aptly/task"
"github.com/gin-gonic/gin"
)
@@ -203,21 +201,3 @@ func apiTasksDelete(c *gin.Context) {
c.JSON(200, delTask)
}
// @Summary Dummy endpoint used for testing.
// @Description **Dummy endpoint used for testing**
// @Tags Tasks
// @Produce json
// @Param _async query bool false "Run task in background using tasks API"
// @Success 200 {object} task.ProcessReturnValue
// @Router /api/tasks-dummy [post]
func apiTasksDummy(c *gin.Context) {
resources := []string{"dummy"}
taskName := "Dummy task"
maybeRunTaskInBackground(c, taskName, resources, func(out aptly.Progress, detail *task.Detail) (*task.ProcessReturnValue, error) {
out.Printf("Dummy task started\n")
detail.Store([]int{1, 2, 3})
out.Printf("Dummy task finished\n")
return &task.ProcessReturnValue{Code: http.StatusTeapot, Value: []int{1, 2, 3}}, nil
})
}