1
0
mirror of https://github.com/newnius/YAO-scheduler.git synced 2025-12-15 08:16:43 +00:00

add switcher for schduler

This commit is contained in:
2020-04-13 18:26:40 +08:00
parent 533099c14b
commit 301071fc87
5 changed files with 43 additions and 3 deletions

View File

@@ -166,6 +166,20 @@ func serverAPI(w http.ResponseWriter, r *http.Request) {
w.Write(js)
break
case "debug_enable":
log.Debug("enable schedule")
js, _ := json.Marshal(scheduler.Enable)
w.Header().Set("Content-Type", "application/json")
w.Write(js)
break
case "debug_disable":
log.Debug("disable schedule")
js, _ := json.Marshal(scheduler.Disable)
w.Header().Set("Content-Type", "application/json")
w.Write(js)
break
default:
http.Error(w, "Not Found", http.StatusNotFound)
break