|
@@ -37,8 +37,9 @@ func NewEtcdClient(startup *initutils.Startup) *clientv3.Client {
|
|
|
|
|
|
|
|
func NewEtcdClientWithCleanup(startup *initutils.Startup) (*clientv3.Client, func()) {
|
|
func NewEtcdClientWithCleanup(startup *initutils.Startup) (*clientv3.Client, func()) {
|
|
|
etcdClient := NewEtcdClient(startup)
|
|
etcdClient := NewEtcdClient(startup)
|
|
|
- cleanup := func() {
|
|
|
|
|
- etcdClient.Close()
|
|
|
|
|
|
|
+ if etcdClient == nil {
|
|
|
|
|
+ return nil, func() {}
|
|
|
}
|
|
}
|
|
|
|
|
+ cleanup := func() { etcdClient.Close() }
|
|
|
return etcdClient, cleanup
|
|
return etcdClient, cleanup
|
|
|
}
|
|
}
|