From 7ff4cac4fc23060a56b9c33a3453c2d26629b699 Mon Sep 17 00:00:00 2001 From: "Gabriel A. Giovanini" Date: Tue, 11 Jun 2024 20:59:02 +0200 Subject: feat: Add server listen configuration --- main.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'main.go') diff --git a/main.go b/main.go index eedff5e..18b73ff 100644 --- a/main.go +++ b/main.go @@ -4,7 +4,6 @@ import ( "context" "flag" "log/slog" - "net/http" "os" "os/signal" "time" @@ -16,7 +15,6 @@ import ( ) func main() { - ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt, os.Kill) defer stop() if err := run(ctx); err != nil { @@ -27,7 +25,7 @@ func main() { func run(ctx context.Context) error { var ( - configPath = flag.String("config", "config.example.scfg", "File path for the configuration file") + configPath = flag.String("config", "/etc/cerrado.scfg", "File path for the configuration file") ) flag.Parse() @@ -46,7 +44,7 @@ func run(ctx context.Context) error { return err } - serverTask := worker.NewServerTask(&http.Server{Handler: handler, Addr: "0.0.0.0:8080"}) + serverTask := worker.NewServerTask(configRepo.GetListenAddr(), handler) pool := worker.NewTaskPool() pool.AddTask("http-server", 5*time.Second, serverTask) -- cgit v1.2.3