mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
v2http: only report capabilities on update
This commit is contained in:
parent
004ff3d4f0
commit
2b7ad35fa0
@ -55,15 +55,13 @@ func capabilityLoop(s *etcdserver.EtcdServer) {
|
|||||||
var pv *semver.Version
|
var pv *semver.Version
|
||||||
for {
|
for {
|
||||||
if v := s.ClusterVersion(); v != pv {
|
if v := s.ClusterVersion(); v != pv {
|
||||||
if pv == nil {
|
if pv == nil || (v != nil && pv.LessThan(*v)) {
|
||||||
pv = v
|
|
||||||
} else if v != nil && pv.LessThan(*v) {
|
|
||||||
pv = v
|
pv = v
|
||||||
|
enableMapMu.Lock()
|
||||||
|
enabledMap = capabilityMaps[pv.String()]
|
||||||
|
enableMapMu.Unlock()
|
||||||
|
plog.Infof("enabled capabilities for version %s", pv)
|
||||||
}
|
}
|
||||||
enableMapMu.Lock()
|
|
||||||
enabledMap = capabilityMaps[pv.String()]
|
|
||||||
enableMapMu.Unlock()
|
|
||||||
plog.Infof("enabled capabilities for version %s", pv)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
select {
|
select {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user