MCPcopy Create free account
hub / github.com/facebook/time / ReadConfig

Function ReadConfig

fbclock/daemon/config.go:117–128  ·  view source on GitHub ↗

ReadConfig reads config and unmarshals it from yaml into Config

(path string)

Source from the content-addressed store, hash-verified

115 log.Debugf("system uptime: %s", uptime)
116
117 if uptime < c.BootDelay {
118 log.Infof("postponing startup by %s", c.BootDelay-uptime)
119 time.Sleep(c.BootDelay - uptime)
120 }
121
122 return nil
123}
124
125// uptime returns system boot time
126func uptime() (time.Duration, error) {
127 var ts unix.Timespec
128
129 if err := unix.ClockGettime(unix.CLOCK_BOOTTIME, &ts); err != nil {
130 return 0, err
131 }

Callers 4

mainFunction · 0.92
TestReadConfigFunction · 0.70
TestReadConfigMissingFunction · 0.70
TestReadConfigInvalidFunction · 0.70

Calls

no outgoing calls

Tested by 3

TestReadConfigFunction · 0.56
TestReadConfigMissingFunction · 0.56
TestReadConfigInvalidFunction · 0.56

Used in the wild real call sites across dependent graphs

searching dependent graphs…