close the existing etcd client if it exists

This commit is contained in:
Asim Aslam 2020-08-07 23:09:06 +01:00
parent 124b1bd7b7
commit 9b14eb8aec

View File

@ -120,6 +120,13 @@ func configure(e *etcdRegistry, opts ...registry.Option) error {
if err != nil {
return err
}
// close the existing client
if e.client != nil {
e.client.Close()
}
// set the new client
e.client = cli
return nil
}