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

Method syncNtpdate

internal/utils/clock/manager.go:133–142  ·  view source on GitHub ↗
(ntpdate string, server string)

Source from the content-addressed store, hash-verified

131}
132
133func (this *ClockManager) syncNtpdate(ntpdate string, server string) error {
134 var cmd = executils.NewTimeoutCmd(30*time.Second, ntpdate, server)
135 cmd.WithStderr()
136 err := cmd.Run()
137 if err != nil {
138 return fmt.Errorf("%w: %s", err, cmd.Stderr())
139 }
140
141 return nil
142}
143
144// ReadServer 参考自:https://medium.com/learning-the-go-programming-language/lets-make-an-ntp-client-in-go-287c4b9a969f
145func (this *ClockManager) ReadServer(server string) (time.Time, error) {

Callers 1

SyncMethod · 0.95

Calls 4

WithStderrMethod · 0.80
ErrorfMethod · 0.80
StderrMethod · 0.80
RunMethod · 0.45

Tested by

no test coverage detected