diff --git a/service/service.go b/service/service.go index a18c073..ba7db0b 100644 --- a/service/service.go +++ b/service/service.go @@ -270,9 +270,14 @@ func (s *service) Stop() error { sigs := s.notify() done := make(chan struct{}) go func() { + defer close(done) + // TODO(adphi): find a better solution + defer func() { + // catch: Drain() is not implemented + recover() + }() logrus.Warn("shutting down gracefully") s.server.GracefulStop() - close(done) }() select { case sig := <-sigs: