diff options
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/tfstated/main.go | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/cmd/tfstated/main.go b/cmd/tfstated/main.go index 8b462f7..a1c74ca 100644 --- a/cmd/tfstated/main.go +++ b/cmd/tfstated/main.go @@ -26,7 +26,8 @@ func run( return err } - backend := backend.Run(ctx, db, getenv, stderr) + backend := backend.Run(ctx, db, getenv) + webui := webui.Run(ctx, db, getenv) <-ctx.Done() shutdownCtx := context.Background() @@ -34,13 +35,17 @@ func run( defer shutdownCancel() var wg sync.WaitGroup - wg.Add(1) + wg.Add(2) go func() { defer wg.Done() if err := backend.Shutdown(shutdownCtx); err != nil { slog.Error("error shutting down backend http server", "error", err) } }() + go func() { + defer wg.Done() + if err := webui.Shutdown(shutdownCtx); err != nil { + slog.Error("error shutting down webui http server", "error", err) } }() wg.Wait() |