diff options
author | Alan Pearce | 2024-12-12 11:09:47 +0100 |
---|---|---|
committer | Alan Pearce | 2024-12-12 18:16:10 +0100 |
commit | fed650743913797a314d8fc7d7550ba21dce0a12 (patch) | |
tree | c2d5e62fafbf9cee7f862927a5894da807f5d34b /cmd | |
parent | b66c1ed87b556844421886ead373ffdd4ca25663 (diff) | |
download | website-nats.tar.lz website-nats.tar.zst website-nats.zip |
setup embedded NATS cluster nats
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/server/main.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/cmd/server/main.go b/cmd/server/main.go index 652ffa3..01b8c54 100644 --- a/cmd/server/main.go +++ b/cmd/server/main.go @@ -6,6 +6,7 @@ import ( "os" "os/signal" + "go.alanpearce.eu/website/internal/nats" "go.alanpearce.eu/website/internal/server" "go.alanpearce.eu/x/log" @@ -52,8 +53,16 @@ func main() { } }() + go func() { + err := nats.Start(log.Named("nats")) + if err != nil { + log.Warn("could not start NATS server", "error", err) + } + }() + <-ctx.Done() log.Debug("calling stop") <-sv.Stop() + nats.Stop() log.Debug("done") } |