diff options
author | Julien Dessaux | 2025-01-02 19:43:53 +0100 |
---|---|---|
committer | Julien Dessaux | 2025-01-02 19:43:53 +0100 |
commit | 24bca7067b02844dc275ed6e22f96f20ab02f82e (patch) | |
tree | 5eab0d3e6d2a0beae78ab4c7be02dd2a60af4af4 /cmd | |
parent | chore(tfstated): code cleanup (diff) | |
download | tfstated-24bca7067b02844dc275ed6e22f96f20ab02f82e.tar.gz tfstated-24bca7067b02844dc275ed6e22f96f20ab02f82e.tar.bz2 tfstated-24bca7067b02844dc275ed6e22f96f20ab02f82e.zip |
feat(tfstated): bootstrap webui listening on a second port
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() |