feat(worker): support graceful shutdown (#459)

* feat(worker): support graceful shutdown

notifications workers and queue have been sent to APNs/FCM before shutdown a push notification.

send buffered channel to signal.Notify to avoid blocking

see: golang/lint#175

fixed: https://github.com/appleboy/gorush/issues/441

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
Bo-Yi Wu
2020-02-04 13:27:27 +08:00
committed by GitHub
parent bcf1c0cd03
commit 2d2a8a0110
10 changed files with 76 additions and 21 deletions

View File

@@ -100,7 +100,7 @@ func (s *Server) Send(ctx context.Context, in *proto.NotificationRequest) (*prot
// RunGRPCServer run gorush grpc server
func RunGRPCServer() error {
if !gorush.PushConf.GRPC.Enabled {
gorush.LogAccess.Debug("gRPC server is disabled.")
gorush.LogAccess.Info("gRPC server is disabled.")
return nil
}