MCPcopy Create free account
hub / github.com/GoEdgeLab/EdgeNode / init

Function init

internal/utils/clock/manager.go:23–43  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

21var sharedClockManager = NewClockManager()
22
23func init() {
24 if !teaconst.IsMain {
25 return
26 }
27
28 events.On(events.EventLoaded, func() {
29 goman.New(sharedClockManager.Start)
30 })
31 events.On(events.EventReload, func() {
32 if !hasSynced {
33 hasSynced = true
34
35 goman.New(func() {
36 err := sharedClockManager.Sync()
37 if err != nil {
38 remotelogs.Warn("CLOCK", "sync clock failed: "+err.Error())
39 }
40 })
41 }
42 })
43}
44
45type ClockManager struct {
46 lastFailAt int64

Callers

nothing calls this directly

Calls 5

OnFunction · 0.92
NewFunction · 0.92
WarnFunction · 0.92
SyncMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected