api: fix OOM with sync tasks

since sync API calls also use tasks internally, this lead to out of memory due to aptly never removing them.
This commit is contained in:
André Roth
2024-08-03 12:44:29 +02:00
parent 735d7a4d61
commit 37a9fbe530
+1
View File
@@ -175,6 +175,7 @@ func maybeRunTaskInBackground(c *gin.Context, name string, resources []string, p
retValue, _ := context.TaskList().GetTaskReturnValueByID(task.ID)
err, _ := context.TaskList().GetTaskErrorByID(task.ID)
context.TaskList().DeleteTaskByID(task.ID)
if err != nil {
AbortWithJSONError(c, retValue.Code, err)
return