MCPcopy Create free account
hub / github.com/1Panel-dev/1Panel / CheckScopeTaskIsExecuting

Function CheckScopeTaskIsExecuting

agent/app/task/task.go:130–141  ·  view source on GitHub ↗
(scope string, resourceID uint)

Source from the content-addressed store, hash-verified

128}
129
130func 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
143func NewTask(name, operate, taskScope, taskID string, resourceID uint) (*Task, error) {
144 if taskID == "" {

Callers

nothing calls this directly

Calls 4

GetFirstMethod · 0.95
WithByStatusMethod · 0.95
WithResourceIDMethod · 0.95
WithByTypeMethod · 0.65

Tested by

no test coverage detected