mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-03 04:19:18 +08:00
check if etcd is health before register session (#6215)
Signed-off-by: yefu.chen <yefu.chen@zilliz.com>
This commit is contained in:
parent
115608afe4
commit
4e4ab4adc6
@ -65,6 +65,11 @@ func NewSession(ctx context.Context, metaRoot string, etcdEndpoints []string) *S
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
ctx2, cancel2 := context.WithTimeout(session.ctx, 5*time.Second)
|
||||
defer cancel2()
|
||||
if _, err = etcdCli.Get(ctx2, "health"); err != nil {
|
||||
return err
|
||||
}
|
||||
session.etcdCli = etcdCli
|
||||
return nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user