orchestrator/clickhouse: ability to fetch network attributes with HTTP

This commit is contained in:
Vincent Bernat
2022-10-13 18:33:29 +02:00
parent 1a0f00bbc4
commit 95482c9201
14 changed files with 578 additions and 49 deletions

View File

@@ -129,10 +129,7 @@ func (c *Component) Start() error {
if c.config.Listen == "" {
return nil
}
server := &http.Server{
Addr: c.config.Listen,
Handler: c.mux,
}
server := &http.Server{Handler: c.mux}
// Most of the time, if we have an error, it's here!
c.r.Info().Str("listen", c.config.Listen).Msg("starting HTTP server")
@@ -141,6 +138,7 @@ func (c *Component) Start() error {
return fmt.Errorf("unable to listen to %v: %w", c.config.Listen, err)
}
c.address = listener.Addr()
server.Addr = listener.Addr().String()
// Start serving requests
c.t.Go(func() error {