Update task status handling to reset runner_id on job cancellation and failure
All checks were successful
Release Tag / release (push) Successful in 20s
All checks were successful
Release Tag / release (push) Successful in 20s
- Modified SQL queries in multiple functions to set runner_id to NULL when updating task statuses for cancelled jobs and failed tasks. - Ensured that tasks are properly marked as failed with the correct error messages and updated completion timestamps. - Improved handling of task statuses to prevent potential issues with task assignment and execution.
This commit is contained in:
@@ -944,7 +944,7 @@ func (s *Manager) handleCancelJob(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
// Cancel all pending tasks
|
||||
_, err = conn.Exec(
|
||||
`UPDATE tasks SET status = ? WHERE job_id = ? AND status = ?`,
|
||||
`UPDATE tasks SET status = ?, runner_id = NULL WHERE job_id = ? AND status = ?`,
|
||||
types.TaskStatusFailed, jobID, types.TaskStatusPending,
|
||||
)
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user