MCPcopy
hub / github.com/CodisLabs/codis / serveAdmin

Method serveAdmin

pkg/proxy/proxy.go:372–394  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

370}
371
372func (s *Proxy) serveAdmin() {
373 if s.IsClosed() {
374 return
375 }
376 defer s.Close()
377
378 log.Warnf("[%p] admin start service on %s", s, s.ladmin.Addr())
379
380 eh := make(chan error, 1)
381 go func(l net.Listener) {
382 h := http.NewServeMux()
383 h.Handle("/", newApiServer(s))
384 hs := &http.Server{Handler: h}
385 eh <- hs.Serve(l)
386 }(s.ladmin)
387
388 select {
389 case <-s.exit.C:
390 log.Warnf("[%p] admin shutdown", s)
391 case err := <-eh:
392 log.ErrorErrorf(err, "[%p] admin exit on error", s)
393 }
394}
395
396func (s *Proxy) serveProxy() {
397 if s.IsClosed() {

Callers 1

NewFunction · 0.95

Calls 7

IsClosedMethod · 0.95
CloseMethod · 0.95
WarnfMethod · 0.80
ServeMethod · 0.80
ErrorErrorfMethod · 0.80
newApiServerFunction · 0.70
AddrMethod · 0.45

Tested by

no test coverage detected