diff --git a/services/tasks/cmd.go b/services/tasks/cmd.go index 76814d1e1..4fa8e536b 100644 --- a/services/tasks/cmd.go +++ b/services/tasks/cmd.go @@ -100,18 +100,11 @@ func start(ctx context.Context) error { return err } - errors := make(chan error, 1) - go func() { - routes := httpRoutes{ - logger: logger, - db: db, - mainScheduler: mainScheduler, - } - errors <- fmt.Errorf("http server: %w", httpserver.RegisterAndStart(ctx, logger, cfg.Http.Address, &routes)) - }() - - return <-errors - + return httpserver.RegisterAndStart(ctx, logger, cfg.Http.Address, &httpRoutes{ + logger: logger, + db: db, + mainScheduler: mainScheduler, + }) } func NewKubeClient() (client.Client, error) {