fix: retry UDP discovery once if first attempt finds no devices
This commit is contained in:
parent
7de906cd91
commit
40dead215e
@ -132,6 +132,9 @@ func (h *Handler) ensureDevicesLoaded() {
|
||||
return
|
||||
}
|
||||
_, _ = h.discovery.SearchDefault()
|
||||
if len(h.registry.GetDevices()) == 0 {
|
||||
_, _ = h.discovery.SearchDefault()
|
||||
}
|
||||
}
|
||||
|
||||
func (h *Handler) ProxyAgent(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
@ -704,6 +704,10 @@ func (u *UI) ensureDevicesLoaded() {
|
||||
return
|
||||
}
|
||||
_, _ = u.discovery.SearchDefault()
|
||||
// Retry once if discovery returned nothing (UDP broadcast can be lossy on some networks)
|
||||
if len(u.registry.GetDevices()) == 0 {
|
||||
_, _ = u.discovery.SearchDefault()
|
||||
}
|
||||
}
|
||||
|
||||
func (u *UI) pageDashboard(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user