mirror of https://bitbucket.org/ausocean/av.git
revid: only set local clock if it hasn't already been set
This commit is contained in:
parent
51c489946a
commit
0f9b06b266
|
@ -136,13 +136,16 @@ func extractMeta(r string, log func(lvl int8, msg string, args ...interface{}))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
// Extract time from reply
|
// Extract time from reply if mts.Realtime has not been set.
|
||||||
t, err := dec.Int("ts")
|
if !mts.RealTime.IsSet() {
|
||||||
if err != nil {
|
t, err := dec.Int("ts")
|
||||||
log(logger.Warning, "No timestamp in reply")
|
if err != nil {
|
||||||
} else {
|
log(logger.Warning, "No timestamp in reply")
|
||||||
log(logger.Debug, fmt.Sprintf("got timestamp: %v", t))
|
} else {
|
||||||
mts.RealTime.Set(time.Unix(int64(t), 0))
|
log(logger.Debug, fmt.Sprintf("got timestamp: %v", t))
|
||||||
|
fmt.Printf("got timestamp: %v, setting\n", t)
|
||||||
|
mts.RealTime.Set(time.Unix(int64(t), 0))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Extract location from reply
|
// Extract location from reply
|
||||||
|
|
Loading…
Reference in New Issue