Skip to content

Commit

Permalink
fix pprof.
Browse files Browse the repository at this point in the history
  • Loading branch information
m1k1o committed Nov 25, 2023
1 parent cdd0e4f commit ffeef5e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 39 deletions.
33 changes: 0 additions & 33 deletions internal/server/debug.go

This file was deleted.

12 changes: 6 additions & 6 deletions internal/server/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,6 @@ func New(ApiManager types.ApiManager, roomConfig *config.Room, config *config.Se
}))
}

// mount pprof endpoint
if config.PProf {
withPProf(router)
logger.Info().Msgf("with pprof endpoint at %s", pprofPath)
}

//
// admin page
//
Expand Down Expand Up @@ -240,6 +234,12 @@ func New(ApiManager types.ApiManager, roomConfig *config.Room, config *config.Se
})
}

// mount pprof endpoint
if config.PProf {
router.Mount("/debug", middleware.Profiler())
logger.Info().Msgf("with pprof endpoint")
}

// handle all remaining paths with proxy
router.Handle("/*", proxyHandler)

Expand Down

0 comments on commit ffeef5e

Please sign in to comment.