From fcd15c9b17701ddd4207e425902551c9d4a71b5f Mon Sep 17 00:00:00 2001 From: Kevin Wan Date: Sun, 14 Mar 2021 08:51:10 +0800 Subject: [PATCH] refactor, and add comments to describe graceful shutdown (#564) --- core/fx/{fn.go => stream.go} | 0 core/fx/{fn_test.go => stream_test.go} | 0 rest/server.go | 2 ++ zrpc/server.go | 2 ++ 4 files changed, 4 insertions(+) rename core/fx/{fn.go => stream.go} (100%) rename core/fx/{fn_test.go => stream_test.go} (100%) diff --git a/core/fx/fn.go b/core/fx/stream.go similarity index 100% rename from core/fx/fn.go rename to core/fx/stream.go diff --git a/core/fx/fn_test.go b/core/fx/stream_test.go similarity index 100% rename from core/fx/fn_test.go rename to core/fx/stream_test.go diff --git a/rest/server.go b/rest/server.go index 10a32fd1..2c3ec2cb 100644 --- a/rest/server.go +++ b/rest/server.go @@ -77,6 +77,8 @@ func (e *Server) AddRoute(r Route, opts ...RouteOption) { } // Start starts the Server. +// Graceful shutdown is enabled by default. +// Use proc.SetTimeToForceQuit to customize the graceful shutdown period. func (e *Server) Start() { handleError(e.opts.start(e.ngin)) } diff --git a/zrpc/server.go b/zrpc/server.go index 9b367667..0f5fe8a5 100644 --- a/zrpc/server.go +++ b/zrpc/server.go @@ -79,6 +79,8 @@ func (rs *RpcServer) AddUnaryInterceptors(interceptors ...grpc.UnaryServerInterc } // Start starts the RpcServer. +// Graceful shutdown is enabled by default. +// Use proc.SetTimeToForceQuit to customize the graceful shutdown period. func (rs *RpcServer) Start() { if err := rs.server.Start(rs.register); err != nil { logx.Error(err)