MCPcopy Create free account
hub / github.com/QuantumNous/new-api / CreateLogCleanupSystemTask

Function CreateLogCleanupSystemTask

controller/system_task.go:14–35  ·  view source on GitHub ↗
(c *gin.Context)

Source from the content-addressed store, hash-verified

12)
13
14func CreateLogCleanupSystemTask(c *gin.Context) {
15 targetTimestamp, _ := strconv.ParseInt(c.Query("target_timestamp"), 10, 64)
16 if targetTimestamp == 0 {
17 c.JSON(http.StatusOK, gin.H{
18 "success": false,
19 "message": "target timestamp is required",
20 })
21 return
22 }
23
24 task, err := service.StartLogCleanupTask(targetTimestamp)
25 if err != nil {
26 common.ApiError(c, err)
27 return
28 }
29
30 c.JSON(http.StatusOK, gin.H{
31 "success": true,
32 "message": "",
33 "data": task.ToResponse(),
34 })
35}
36
37func GetCurrentSystemTask(c *gin.Context) {
38 taskType := c.Query("type")

Callers

nothing calls this directly

Calls 4

StartLogCleanupTaskFunction · 0.92
ApiErrorFunction · 0.92
QueryMethod · 0.80
ToResponseMethod · 0.45

Tested by

no test coverage detected