use router.Stop

This commit is contained in:
Joel Wetzell
2025-12-26 10:43:04 -06:00
parent 18b307bca1
commit cc37559bde

View File

@@ -103,9 +103,7 @@ func run(ctx context.Context, c *cli.Command) error {
commandLogger := slog.Default().With("component", "cmd") commandLogger := slog.Default().With("component", "cmd")
routerContext, routerCancel := context.WithCancel(context.Background()) router, moduleErrors, routeErrors := showbridge.NewRouter(context.Background(), config)
router, moduleErrors, routeErrors := showbridge.NewRouter(routerContext, config)
for _, moduleError := range moduleErrors { for _, moduleError := range moduleErrors {
commandLogger.Error("problem initializing module", "index", moduleError.Index, "error", moduleError.Error) commandLogger.Error("problem initializing module", "index", moduleError.Index, "error", moduleError.Error)
@@ -123,7 +121,7 @@ func run(ctx context.Context, c *cli.Command) error {
<-ctx.Done() <-ctx.Done()
commandLogger.Debug("shutting down router") commandLogger.Debug("shutting down router")
routerCancel() router.Stop()
commandLogger.Debug("waiting for router to exit") commandLogger.Debug("waiting for router to exit")
routerRunner.Wait() routerRunner.Wait()
return nil return nil