fix: resolve task timeout bug and refactor remote executor wait logic
- Prevent hardcoded 30-minute timeout when timeout is set to 0. - Fix zombie processes by actively stopping tasks during deletion. - Refactor remote execution wait logic to properly handle ctx.Done() and agent disconnections.
This commit is contained in:
@@ -362,6 +362,7 @@ func (tc *TaskController) DeleteTask(c *gin.Context) {
|
||||
}
|
||||
|
||||
tc.executorService.RemoveCronTask(id)
|
||||
tc.executorService.GetScheduler().StopTask(id)
|
||||
|
||||
success := tc.taskService.DeleteTask(id)
|
||||
if !success {
|
||||
@@ -460,6 +461,7 @@ func (tc *TaskController) BatchDeleteTasks(c *gin.Context) {
|
||||
|
||||
// 移除 cron 调度
|
||||
tc.executorService.RemoveCronTask(id)
|
||||
tc.executorService.GetScheduler().StopTask(id)
|
||||
}
|
||||
|
||||
// 执行批量删除
|
||||
@@ -513,6 +515,7 @@ func (tc *TaskController) BatchDeleteByQuery(c *gin.Context) {
|
||||
}
|
||||
// 移除 cron 调度
|
||||
tc.executorService.RemoveCronTask(task.ID)
|
||||
tc.executorService.GetScheduler().StopTask(task.ID)
|
||||
}
|
||||
|
||||
// 执行批量删除
|
||||
|
||||
Reference in New Issue
Block a user