From 70913ba556d1df44ec007702e0a825de78b056c6 Mon Sep 17 00:00:00 2001 From: Adphi Date: Sun, 15 May 2022 14:12:38 +0200 Subject: [PATCH] shutdown: catch Drain() is not implemented Signed-off-by: Adphi --- service/service.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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: