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

Function CheckResourceTaskIsExecuting

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

Source from the content-addressed store, hash-verified

118}
119
120func CheckResourceTaskIsExecuting(operate, scope string, resourceID uint) bool {
121 taskRepo := repo.NewITaskRepo()
122 task, _ := taskRepo.GetFirst(
123 taskRepo.WithByStatus(constant.StatusExecuting),
124 taskRepo.WithResourceID(resourceID),
125 taskRepo.WithOperate(operate),
126 repo.WithByType(scope))
127 return task.ID != ""
128}
129
130func CheckScopeTaskIsExecuting(scope string, resourceID uint) error {
131 taskRepo := repo.NewITaskRepo()

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected