Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
cr0hn committed May 17, 2019
2 parents fd151c0 + 249f7d1 commit a0cbe64
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,17 @@ func NewServer(conf *Config) (*Server, error) {
// Create metrics server
server.metricsServer = metrics.NewServer(conf.MetricsAddr)

// Create profiling server
if server.conf.EnableProfiling {
go func() {
log.Debug(" * Starting QED Profiling server in addr: ", server.conf.ProfilingAddr)
err := http.ListenAndServe(server.conf.ProfilingAddr, nil)
if err != http.ErrServerClosed {
log.Errorf("Can't start QED Profiling Server: %s", err)
}
}()
}

// Create gossip agent
config := gossip.DefaultConfig()
config.BindAddr = conf.GossipAddr
Expand Down Expand Up @@ -202,16 +213,6 @@ func (s *Server) Start() error {
log.Debugf(" * Starting metrics HTTP server in addr: %s", s.conf.MetricsAddr)
s.metricsServer.Start()

if s.conf.EnableProfiling {
go func() {
log.Debug(" * Starting QED Profiling server in addr: ", s.conf.ProfilingAddr)
err := http.ListenAndServe(s.conf.ProfilingAddr, nil)
if err != http.ErrServerClosed {
log.Errorf("Can't start QED Profiling Server: %s", err)
}
}()
}

if s.conf.EnableTLS {
go func() {
log.Debug(" * Starting QED API HTTPS server in addr: ", s.conf.HTTPAddr)
Expand Down

0 comments on commit a0cbe64

Please sign in to comment.