fix block in warden client init register discovery (#79)

* fix block in warden client init register discovery
* rm empty tab
pull/88/head
Felix Hao 6 years ago committed by GitHub
parent 25703cd9cf
commit 2f4e80261b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      pkg/net/rpc/warden/client.go
  2. 2
      tool/kratos/template.go

@ -43,10 +43,6 @@ var (
_defaultClient *Client _defaultClient *Client
) )
func init() {
resolver.Register(discovery.New(nil))
}
func baseMetadata() metadata.MD { func baseMetadata() metadata.MD {
gmd := metadata.MD{nmd.Caller: []string{env.AppID}} gmd := metadata.MD{nmd.Caller: []string{env.AppID}}
if env.Color != "" { if env.Color != "" {

@ -100,7 +100,7 @@ func main() {
ctx, cancel := context.WithTimeout(context.Background(), 35*time.Second) ctx, cancel := context.WithTimeout(context.Background(), 35*time.Second)
if err := grpcSrv.Shutdown(ctx); err != nil { if err := grpcSrv.Shutdown(ctx); err != nil {
log.Error("grpcSrv.Shutdown error(%v)", err) log.Error("grpcSrv.Shutdown error(%v)", err)
} // grpc }
if err := httpSrv.Shutdown(ctx); err != nil { if err := httpSrv.Shutdown(ctx); err != nil {
log.Error("httpSrv.Shutdown error(%v)", err) log.Error("httpSrv.Shutdown error(%v)", err)
} }

Loading…
Cancel
Save