mirror of
https://github.com/go-kratos/kratos.git
synced 2025-03-17 21:07:54 +02:00
parent
c873ef1ce9
commit
cba8028987
@ -1,6 +1,7 @@
|
||||

|
||||
|
||||
[](https://golang.org/)
|
||||
[](https://godoc.org/github.com/bilibili/kratos)
|
||||
|
||||
Kratos是[bilibili](https://www.bilibili.com)开源的一套Go微服务框架,包含大量微服务相关框架及工具:
|
||||
|
||||
|
@ -98,11 +98,15 @@ func main() {
|
||||
switch s {
|
||||
case syscall.SIGQUIT, syscall.SIGTERM, syscall.SIGINT:
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 35*time.Second)
|
||||
defer cancel()
|
||||
grpcSrv.Shutdown(ctx)
|
||||
httpSrv.Shutdown(ctx)
|
||||
if err := grpcSrv.Shutdown(ctx); err != nil
|
||||
log.Error("grpcSrv.Shutdown error(%v)", err)
|
||||
} // grpc
|
||||
if err := httpSrv.Shutdown(ctx); err != nil {
|
||||
log.Error("httpSrv.Shutdown error(%v)", err)
|
||||
}
|
||||
log.Info("{{.Name}} exit")
|
||||
svc.Close()
|
||||
cancel()
|
||||
time.Sleep(time.Second)
|
||||
return
|
||||
case syscall.SIGHUP:
|
||||
|
Loading…
x
Reference in New Issue
Block a user