mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-09-07 00:55:55 +00:00
Requested changes
Signed-off-by: Antonio Navarro Perez <antnavper@gmail.com>
This commit is contained in:
parent
851c41cd45
commit
955ab2b5a0
1 changed files with 6 additions and 6 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue