Detect initial update independently from timeout
This commit is contained in:
parent
25b8b4d34b
commit
c8f58117f9
1 changed files with 3 additions and 1 deletions
|
|
@ -164,12 +164,14 @@ func (h *msgHandler) waitForInitialValue() {
|
|||
mlog.TRACE.Printf("%s wait for initial value", h.topic)
|
||||
|
||||
for {
|
||||
updated := h.updated
|
||||
|
||||
// wait for update
|
||||
h.mux.Unlock()
|
||||
time.Sleep(waitTimeout)
|
||||
h.mux.Lock()
|
||||
|
||||
if time.Since(h.updated) < h.timeout {
|
||||
if updated != h.updated {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue