Fixed bug with help of cyoung found with running on native linux, which may show itself on the RaspberryPi at some point

pull/510/head
Jim Jacobsen 2016-10-17 22:30:43 -05:00
rodzic 0f8e5810c6
commit 463ecafc38
1 zmienionych plików z 1 dodań i 2 usunięć

Wyświetl plik

@ -123,9 +123,8 @@ func getDHCPLeases() (map[string]string, error) {
func isSleeping(k string) bool {
ipAndPort := strings.Split(k, ":")
lastPing, ok := pingResponse[ipAndPort[0]]
// No ping response. Assume disconnected/sleeping device.
if !ok || stratuxClock.Since(lastPing) > (10*time.Second) {
if lastPing, ok := pingResponse[ipAndPort[0]]; !ok || stratuxClock.Since(lastPing) > (10*time.Second) {
return true
}
if stratuxClock.Since(outSockets[k].LastUnreachable) < (5 * time.Second) {