MCPcopy Index your code
hub / github.com/GoEdgeLab/EdgeNode / Start

Method Start

internal/utils/clock/manager.go:54–68  ·  view source on GitHub ↗

Start 启动

()

Source from the content-addressed store, hash-verified

52
53// Start 启动
54func (this *ClockManager) Start() {
55 var ticker = time.NewTicker(1 * time.Hour)
56 for range ticker.C {
57 err := this.Sync()
58 if err != nil {
59 var currentTimestamp = time.Now().Unix()
60
61 // 每天只提醒一次错误
62 if currentTimestamp-this.lastFailAt > 86400 {
63 remotelogs.Warn("CLOCK", "sync clock failed: "+err.Error())
64 this.lastFailAt = currentTimestamp
65 }
66 }
67 }
68}
69
70// Sync 自动校对时间
71func (this *ClockManager) Sync() error {

Callers

nothing calls this directly

Calls 4

SyncMethod · 0.95
WarnFunction · 0.92
UnixMethod · 0.80
ErrorMethod · 0.45

Tested by

no test coverage detected