diff --git a/.gitignore b/.gitignore index e78c1803..ad25e74f 100755 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,7 @@ error_pages/ !examples/error_pages/ profiles/ data/ +debug/ logs/ log/ diff --git a/Makefile b/Makefile index d75be153..21264e22 100755 --- a/Makefile +++ b/Makefile @@ -50,6 +50,8 @@ export GODEBUG export GORACE export BUILD_FLAGS +.PHONY: debug + test: GODOXY_TEST=1 go test ./internal/... diff --git a/internal/api/v1/debug/handler.go b/internal/api/v1/debug/handler.go index 51f75632..271ab09c 100644 --- a/internal/api/v1/debug/handler.go +++ b/internal/api/v1/debug/handler.go @@ -22,7 +22,7 @@ import ( func StartServer(cfg config.ConfigInstance) { srv := server.NewServer(server.Options{ Name: "debug", - HTTPAddr: ":8899", + HTTPAddr: "127.0.0.1:7777", Handler: newHandler(cfg), }) srv.Start(task.RootTask("debug_server", false)) @@ -67,7 +67,7 @@ func iterMap[K comparable, V debuggable](m func() map[K]V) iter.Seq2[K, V] { func newHandler(cfg config.ConfigInstance) http.Handler { mux := servemux.NewServeMux(cfg) mux.HandleFunc("GET", "/tasks", jsonHandler(task.AllTasks())) - mux.HandleFunc("GET", "/idlewatcher", jsonHandler(iterMap(idlewatcher.Watchers))) + mux.HandleFunc("GET", "/idlewatcher", jsonHandler(idlewatcher.Watchers())) mux.HandleFunc("GET", "/agents", jsonHandler(agent.Agents.Iter)) mux.HandleFunc("GET", "/proxmox", jsonHandler(proxmox.Clients.Iter)) mux.HandleFunc("GET", "/docker", jsonHandler(iterMap(docker.Clients)))