This commit is contained in:
crusader 2017-12-18 18:32:26 +09:00
parent c9fbeb37d8
commit bd224840cf

View File

@ -81,6 +81,13 @@ func (s *rpcServlet) Start(parentCTX cuc.Context, conn interface{}, doneChan cha
} }
func (s *rpcServlet) Stop() { 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) s.destroy(nil)
} }
@ -103,12 +110,6 @@ func (s *rpcServlet) Context() ServletContext {
} }
func (s *rpcServlet) destroy(err error) { 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.stopWg.Wait()
s.sh.Destroy(s.ctx) s.sh.Destroy(s.ctx)