Browse Source

Expose profile listener internally

pull/265/head
Book Moons 4 years ago
parent
commit
97f538d366
No known key found for this signature in database GPG Key ID: 29D2A92F3145E7A7
1 changed files with 7 additions and 1 deletions
  1. +7
    -1
      server/server.go

+ 7
- 1
server/server.go View File

@@ -279,6 +279,8 @@ type Server struct {
TLSListenerString string
ProfileListenerString string

profileListener *http.Server

Certificate string

LetsEncryptCache string
@@ -305,11 +307,15 @@ func (s *Server) Run() {

if s.profilerEnabled {
listening = true
profileListener := &http.Server{
Addr: ":6060",
}
s.profileListener = profileListener

go func() {
s.logger.Println("Profiled listening at: :6060")

http.ListenAndServe(":6060", nil)
profileListener.ListenAndServe()
}()
}



Loading…
Cancel
Save