fix(backend):

临时解决修复偶发mongo多节点信息的问题,后续需重构
This commit is contained in:
yaziming
2019-12-26 11:26:41 +08:00
parent 61927cb214
commit 659aae4abb

View File

@@ -63,7 +63,9 @@ func GetCurrentNode() (Node, error) {
// 如果获取失败
if err != nil {
// 如果为主节点,表示为第一次注册,插入节点信息
if IsMaster() {
// update: 增加具体错误过滤。防止加入多个master节点后续需要职责拆分
//只在master节点运行的时候才检测master节点的信息是否存在
if IsMaster() && err == mgo.ErrNotFound {
// 获取本机信息
ip, mac, key, err := GetNodeBaseInfo()
if err != nil {