节点启动错误时自动尝试从本地读取缓存数据

This commit is contained in:
刘祥超
2021-06-15 10:55:49 +08:00
parent 34aa6125df
commit d237ee6b5b

View File

@@ -83,9 +83,14 @@ func (this *Node) Start() {
}
// 读取API配置
err = this.syncConfig()
if err != nil {
_, err := nodeconfigs.SharedNodeConfig()
if err != nil {
// 无本地数据时,会尝试多次读取
tryTimes := 0
for {
err = this.syncConfig()
err := this.syncConfig()
if err != nil {
tryTimes++
@@ -102,6 +107,8 @@ func (this *Node) Start() {
break
}
}
}
}
// 启动同步计时器
this.startSyncTimer()