mirror of
https://github.com/linka-cloud/grpc.git
synced 2024-11-22 02:46:25 +00:00
shutdown: catch Drain() is not implemented
Signed-off-by: Adphi <philippe.adrien.nousse@gmail.com>
This commit is contained in:
parent
e5a45801a1
commit
70913ba556
@ -270,9 +270,14 @@ func (s *service) Stop() error {
|
|||||||
sigs := s.notify()
|
sigs := s.notify()
|
||||||
done := make(chan struct{})
|
done := make(chan struct{})
|
||||||
go func() {
|
go func() {
|
||||||
|
defer close(done)
|
||||||
|
// TODO(adphi): find a better solution
|
||||||
|
defer func() {
|
||||||
|
// catch: Drain() is not implemented
|
||||||
|
recover()
|
||||||
|
}()
|
||||||
logrus.Warn("shutting down gracefully")
|
logrus.Warn("shutting down gracefully")
|
||||||
s.server.GracefulStop()
|
s.server.GracefulStop()
|
||||||
close(done)
|
|
||||||
}()
|
}()
|
||||||
select {
|
select {
|
||||||
case sig := <-sigs:
|
case sig := <-sigs:
|
||||||
|
Loading…
Reference in New Issue
Block a user