(scope string, resourceID uint)
| 128 | } |
| 129 | |
| 130 | func CheckScopeTaskIsExecuting(scope string, resourceID uint) error { |
| 131 | taskRepo := repo.NewITaskRepo() |
| 132 | task, _ := taskRepo.GetFirst( |
| 133 | taskRepo.WithByStatus(constant.StatusExecuting), |
| 134 | taskRepo.WithResourceID(resourceID), |
| 135 | repo.WithByType(scope), |
| 136 | ) |
| 137 | if task.ID != "" { |
| 138 | return buserr.New("TaskIsExecuting") |
| 139 | } |
| 140 | return nil |
| 141 | } |
| 142 | |
| 143 | func NewTask(name, operate, taskScope, taskID string, resourceID uint) (*Task, error) { |
| 144 | if taskID == "" { |
nothing calls this directly
no test coverage detected