mirror of
https://github.com/zeromicro/go-zero.git
synced 2025-01-23 09:00:20 +08:00
refactor, and add comments to describe graceful shutdown (#564)
This commit is contained in:
parent
155e6061cb
commit
fcd15c9b17
@ -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))
|
||||
}
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user