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:
14
src/main.go
14
src/main.go
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user