mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
discovery: add fast path
This commit is contained in:
parent
2b623cf0fa
commit
b8eb21c027
@ -29,6 +29,13 @@ type discovery struct {
|
||||
}
|
||||
|
||||
func (d *discovery) discover() (*etcdhttp.Peers, error) {
|
||||
// fast path: if the cluster is full, returns the error
|
||||
// do not need to register itself to the cluster in this
|
||||
// case.
|
||||
if _, _, err := d.checkCluster(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if err := d.createSelf(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user