Skip to content

Commit

Permalink
Merge pull request #1 from FGadvancer/main
Browse files Browse the repository at this point in the history
feat: change close function to interface Adapting for Kubernetes
  • Loading branch information
FGadvancer authored Oct 26, 2023
2 parents e57fda1 + 56ec64c commit ad22819
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions discoveryregistry/discovery_register.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,5 @@ type SvcDiscoveryRegistry interface {
CreateRpcRootNodes(serviceNames []string) error
RegisterConf2Registry(key string, conf []byte) error
GetConfFromRegistry(key string) ([]byte, error)
Close()
}
4 changes: 2 additions & 2 deletions discoveryregistry/zookeeper/zk.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ func NewClient(zkServers []string, zkRoot string, options ...ZkOption) (*ZkClien
client.eventChan = eventChan
client.conn = conn
if err := client.ensureRoot(); err != nil {
client.CloseZK()
client.Close()
return nil, err
}
resolver.Register(client)
Expand All @@ -147,7 +147,7 @@ func NewClient(zkServers []string, zkRoot string, options ...ZkOption) (*ZkClien
return client, nil
}

func (s *ZkClient) CloseZK() {
func (s *ZkClient) Close() {
s.logger.Printf("close zk called")
s.cancel()
s.ticker.Stop()
Expand Down

0 comments on commit ad22819

Please sign in to comment.