Skip to content

Commit

Permalink
edit grpc
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaowc-mac committed Jan 12, 2024
1 parent 9bda3b7 commit ed568b0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions microdule.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ func (s *service) Close() {
s.opts.Etcd.Close()
}

if s.opts.Rpc != nil {
s.opts.Rpc.Close()
}

s.opts.Teamwork.Close()
}

Expand Down
4 changes: 4 additions & 0 deletions rpc/grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,7 @@ func (g *Grpc) Run() error {

return nil
}

func (g *Grpc) Close() {
g.EtcdRegister.Close()
}
1 change: 1 addition & 0 deletions rpc/rpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ type Rpc interface {
Client() any
Register(*etcdClientV3.Client) (*grpcs.ServiceRegister, error)
Run() error
Close()
}

type Grpc struct {
Expand Down

0 comments on commit ed568b0

Please sign in to comment.