Skip to content

Commit

Permalink
remove:remove unuse model func, add task status for completion workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
iwanghc committed Oct 8, 2024
1 parent 50d9537 commit eca1aed
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
5 changes: 0 additions & 5 deletions sqle/model/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -527,11 +527,6 @@ func (s *Storage) UpdateTaskStatusByIDs(taskIDs []uint, attrs interface{}) error
return errors.ConnectStorageErrWrapper(err)
}

func updateExecuteSQLStatusByTaskId(tx *gorm.DB, taskId uint, status string) error {
query := "UPDATE execute_sql_detail SET exec_status=? WHERE task_id=?"
return tx.Exec(query, status, taskId).Error
}

func updateExecuteSQLStatusByTaskIdAndStatus(tx *gorm.DB, taskId uint, status []string, updateToStatus string) error {
query := "UPDATE execute_sql_detail SET exec_status=? WHERE task_id=? AND exec_status IN (?)"
return tx.Exec(query, updateToStatus, taskId, status).Error
Expand Down
2 changes: 1 addition & 1 deletion sqle/model/workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -830,7 +830,7 @@ func (s *Storage) CompletionWorkflow(w *Workflow, operateStep *WorkflowStep, nee
if err != nil {
return err
}
err = updateTaskStatusByIdAndStatus(tx, inst.TaskId, []string{TaskStatusExecuteFailed}, TaskStatusManuallyExecuted)
err = updateTaskStatusByIdAndStatus(tx, inst.TaskId, []string{TaskStatusAudited, TaskStatusExecuteFailed}, TaskStatusManuallyExecuted)
if err != nil {
return err
}
Expand Down

0 comments on commit eca1aed

Please sign in to comment.