From 955ab2b5a044fd6ef970529866145feb65a38cc0 Mon Sep 17 00:00:00 2001 From: Antonio Navarro Perez Date: Fri, 5 Mar 2021 13:51:19 +0100 Subject: [PATCH] Requested changes Signed-off-by: Antonio Navarro Perez --- etcd/embed.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/etcd/embed.go b/etcd/embed.go index db8e5672f..7e4fd8446 100644 --- a/etcd/embed.go +++ b/etcd/embed.go @@ -78,7 +78,7 @@ type Etcd struct { e *embed.Etcd cli *clientv3.Client - heartBeatLeasedKV, resizeLeasedKV *leasedKV + heartbeatLeasedKV, resizeLeasedKV *leasedKV } func NewEtcd(opt Options, replicas int) *Etcd { @@ -100,8 +100,8 @@ func (e *Etcd) Close() error { e.resizeLeasedKV.Stop() e.resizeLeasedKV = nil } - if e.heartBeatLeasedKV != nil { - e.heartBeatLeasedKV.Stop() + if e.heartbeatLeasedKV != nil { + e.heartbeatLeasedKV.Stop() } e.e.Close() @@ -202,9 +202,9 @@ func (e *Etcd) Start(ctx context.Context) (disco.InitialClusterState, error) { func (e *Etcd) startHeartbeat(ctx context.Context) error { key := heartbeatPrefix + e.e.Server.ID().String() - e.heartBeatLeasedKV = newLeasedKV(e.cli, key, e.options.HeartbeatTTL) + e.heartbeatLeasedKV = newLeasedKV(e.cli, key, e.options.HeartbeatTTL) - if err := e.heartBeatLeasedKV.Start(string(disco.NodeStateStarting)); err != nil { + if err := e.heartbeatLeasedKV.Start(string(disco.NodeStateStarting)); err != nil { return errors.Wrap(err, "startHeartbeat: starting a new heartbeat") } @@ -283,7 +283,7 @@ func (e *Etcd) NodeStates(ctx context.Context) (map[string]disco.NodeState, erro } func (e *Etcd) Started(ctx context.Context) (err error) { - return e.heartBeatLeasedKV.Set(ctx, string(disco.NodeStateStarted)) + return e.heartbeatLeasedKV.Set(ctx, string(disco.NodeStateStarted)) } func (e *Etcd) ID() string {