Skip to content

Commit

Permalink
Update and sync listening messages
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Ellis <[email protected]>
  • Loading branch information
alexellis committed Jul 11, 2019
1 parent 8f4cd8a commit e4748bd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ func main() {
MaxHeaderBytes: 1 << 20, // Max header of 1MB
}

log.Printf("Timeouts: read: %s, write: %s hard: %s.\n",
watchdogConfig.HTTPReadTimeout,
watchdogConfig.HTTPWriteTimeout,
watchdogConfig.ExecTimeout)
log.Printf("Listening on port: %d\n", watchdogConfig.TCPPort)

listenUntilShutdown(shutdownTimeout, s, watchdogConfig.SuppressLock)
}

Expand Down Expand Up @@ -107,8 +113,6 @@ func listenUntilShutdown(shutdownTimeout time.Duration, s *http.Server, suppress

// Run the HTTP server in a separate go-routine.
go func() {
log.Printf("HTTP server. Listen: %v", s.Addr)

if err := s.ListenAndServe(); err != http.ErrServerClosed {
log.Printf("Error ListenAndServe: %v", err)
close(idleConnsClosed)
Expand Down
2 changes: 1 addition & 1 deletion metrics/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func (m *MetricsServer) Register(metricsPort int) {

// Serve http traffic in go routine, non-blocking
func (m *MetricsServer) Serve(cancel chan bool) {
log.Printf("Metrics server. Port: %d\n", m.port)
log.Printf("Metrics listening on port: %d\n", m.port)

go func() {
if err := m.s.ListenAndServe(); err != http.ErrServerClosed {
Expand Down

0 comments on commit e4748bd

Please sign in to comment.