(withCheck bool, clamRepo repo.IClamRepo)
| 69 | } |
| 70 | |
| 71 | func 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 | } |
nothing calls this directly
no test coverage detected