fix(go): repair migration wire contracts and runtime lifecycle; document incomplete port

This commit is contained in:
CAtlas0784 committed 2026-10-29 15:35:35 +07:00
1 parent e43a310617
commit 32e47014b5
35 files changed
+16826 -438

No files matched your search

+12 -2
View File
@@ -6,6 +6,7 @@ import (
"fmt"
"html/template"
"log"
"net"
"net/http"
"sync"
"time"
@@ -43,15 +44,24 @@ func (a *AdminServer) Start() error {
mux.HandleFunc("/api/command", a.handleCommand)
mux.HandleFunc("/api/sessions", a.handleSessions)
addr := fmt.Sprintf("%s:%d", a.cfg.Network.BindHost, a.cfg.Admin.Port)
host := a.cfg.Admin.Host
if host == "" {
host = "127.0.0.1"
}
addr := net.JoinHostPort(host, fmt.Sprint(a.cfg.Admin.Port))
a.httpSrv = &http.Server{
Addr: addr,
Handler: mux,
}
ln, err := net.Listen("tcp", addr)
if err != nil {
cancel()
return err
}
go func() {
log.Printf("[ADMIN-GM] Admin Web Panel running at http://%s:%d/", a.cfg.Network.AdvertisedHost, a.cfg.Admin.Port)
if err := a.httpSrv.ListenAndServe(); err != nil && err != http.ErrServerClosed {
if err := a.httpSrv.Serve(ln); err != nil && err != http.ErrServerClosed {
log.Printf("[ADMIN-GM] Web server error: %v", err)
}
}()