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

Function CheckWithStopAll

agent/utils/clam/clam.go:71–88  ·  view source on GitHub ↗
(withCheck bool, clamRepo repo.IClamRepo)

Source from the content-addressed store, hash-verified

69}
70
71func CheckWithStopAll(withCheck bool, clamRepo repo.IClamRepo) bool {
72 if withCheck {
73 isExist, _ := controller.CheckExist("clam")
74 if !isExist {
75 return false
76 }
77 isActive, _ := controller.CheckActive("clam")
78 if isActive {
79 return true
80 }
81 }
82 clams, _ := clamRepo.List(repo.WithByStatus(constant.StatusEnable))
83 for i := 0; i < len(clams); i++ {
84 global.Cron.Remove(cron.EntryID(clams[i].EntryID))
85 _ = clamRepo.Update(clams[i].ID, map[string]interface{}{"status": constant.StatusDisable, "entry_id": 0})
86 }
87 return false
88}

Callers

nothing calls this directly

Calls 4

CheckExistMethod · 0.65
ListMethod · 0.65
WithByStatusMethod · 0.65
UpdateMethod · 0.65

Tested by

no test coverage detected