From bd224840cf539e6eb57f91cefcca681808577411 Mon Sep 17 00:00:00 2001 From: crusader Date: Mon, 18 Dec 2017 18:32:26 +0900 Subject: [PATCH] ing --- servlet.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/servlet.go b/servlet.go index 99a9482..76d3885 100644 --- a/servlet.go +++ b/servlet.go @@ -81,6 +81,13 @@ func (s *rpcServlet) Start(parentCTX cuc.Context, conn interface{}, doneChan cha } func (s *rpcServlet) Stop() { + if s.stopChan == nil { + logging.Logger().Warn("Server: server must be started before stopping it") + return + } + + close(s.stopChan) + s.destroy(nil) } @@ -103,12 +110,6 @@ func (s *rpcServlet) Context() ServletContext { } func (s *rpcServlet) destroy(err error) { - if s.stopChan == nil { - logging.Logger().Warn("Server: server must be started before stopping it") - return - } - - close(s.stopChan) s.stopWg.Wait() s.sh.Destroy(s.ctx)