mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-07 18:50:26 +08:00
集群增加自动同步时钟选项
This commit is contained in:
@@ -2,7 +2,9 @@ package models
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"github.com/TeaOSLab/EdgeAPI/internal/remotelogs"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/dnsconfigs"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/nodeconfigs"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs/ddosconfigs"
|
||||
)
|
||||
|
||||
@@ -50,3 +52,15 @@ func (this *NodeCluster) HasDDoSProtection() bool {
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// DecodeClock 解析时钟配置
|
||||
func (this *NodeCluster) DecodeClock() *nodeconfigs.ClockConfig {
|
||||
var clock = nodeconfigs.DefaultClockConfig()
|
||||
if IsNotNull(this.Clock) {
|
||||
err := json.Unmarshal(this.Clock, clock)
|
||||
if err != nil {
|
||||
remotelogs.Error("NodeCluster.DecodeClock()", err.Error())
|
||||
}
|
||||
}
|
||||
return clock
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user