d9414e4cba
Full DAG engine app with CLI subcommands (run, list, status, validate, server) and React/Mantine web frontend. Uses net/http + embedded Vite build. SQLite store for run history. Scheduler with cron_ticker for automated execution. Compatible with existing dagu YAML format. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
28 lines
753 B
Go
28 lines
753 B
Go
package main
|
|
|
|
import "net/http"
|
|
|
|
func handleSchedulerStart(scheduler *Scheduler) http.HandlerFunc {
|
|
return func(w http.ResponseWriter, r *http.Request) {
|
|
if err := scheduler.Start(); err != nil {
|
|
writeError(w, http.StatusConflict, err.Error())
|
|
return
|
|
}
|
|
writeJSON(w, http.StatusOK, map[string]string{"status": "started"})
|
|
}
|
|
}
|
|
|
|
func handleSchedulerStop(scheduler *Scheduler) http.HandlerFunc {
|
|
return func(w http.ResponseWriter, r *http.Request) {
|
|
scheduler.Stop()
|
|
writeJSON(w, http.StatusOK, map[string]string{"status": "stopped"})
|
|
}
|
|
}
|
|
|
|
func handleSchedulerStatus(scheduler *Scheduler) http.HandlerFunc {
|
|
return func(w http.ResponseWriter, r *http.Request) {
|
|
status := scheduler.Status()
|
|
writeJSON(w, http.StatusOK, status)
|
|
}
|
|
}
|