summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2024-08-22 10:31:43 +0300
committerPaul Buetow <paul@buetow.org>2024-08-22 10:31:43 +0300
commitf2b9094e301ac764930feaca93f1f0705f3e1a04 (patch)
tree62dedc06f8a90c1c4f9906269e8e44698f530257 /cmd
parentb9aac1245c586ed3a78713e7b47f1e00c71a9aa2 (diff)
initial scheduler
Diffstat (limited to 'cmd')
-rw-r--r--cmd/gosd/main.go10
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())