ultra hacks to make debug handler work in proxy

This commit is contained in:
Asim Aslam
2019-12-02 14:55:35 +00:00
parent 3356b83f24
commit 91e9c0cb62
3 changed files with 19 additions and 13 deletions

View File

@@ -16,8 +16,6 @@ import (
"github.com/micro/go-micro/server"
"github.com/micro/go-micro/util/log"
"github.com/micro/go-micro/util/wrapper"
pb "github.com/micro/go-micro/debug/proto"
)
type service struct {
@@ -143,9 +141,12 @@ func (s *service) Stop() error {
func (s *service) Run() error {
// register the debug handler
pb.RegisterDebugHandler(s.opts.Server,
handler.DefaultHandler,
server.InternalHandler(true))
s.opts.Server.Handle(
s.opts.Server.NewHandler(
handler.DefaultHandler,
server.InternalHandler(true),
),
)
// start the profiler
// TODO: set as an option to the service, don't just use pprof