diff options
Diffstat (limited to 'cmd/gosd')
| -rw-r--r-- | cmd/gosd/main.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/cmd/gosd/main.go b/cmd/gosd/main.go index e83d6f8..a40d2fa 100644 --- a/cmd/gosd/main.go +++ b/cmd/gosd/main.go @@ -11,6 +11,7 @@ import ( "codeberg.org/snonux/gos/internal/server" "codeberg.org/snonux/gos/internal/server/cron" "codeberg.org/snonux/gos/internal/server/handler" + "codeberg.org/snonux/gos/internal/server/health" ) func main() { @@ -22,16 +23,15 @@ func main() { } var ( - serv = server.New(conf) - hand = handler.New(conf) + status = health.NewStatus() + serv = server.New(conf, status) + hand = handler.New(conf) ) ctx, cancel := context.WithCancel(context.Background()) defer cancel() - if err := cron.Start(ctx, conf); err != nil { - panic(err) - } + go cron.Run(ctx, conf, status) serv.Handle("health", func(w http.ResponseWriter, r *http.Request) error { fmt.Fprint(w, serv.Status.String()) |
