kopia lustrzana https://github.com/cyoung/stratux
Fixed bug with help of cyoung found with running on native linux, which may show itself on the RaspberryPi at some point
rodzic
0f8e5810c6
commit
463ecafc38
|
@ -123,9 +123,8 @@ func getDHCPLeases() (map[string]string, error) {
|
||||||
|
|
||||||
func isSleeping(k string) bool {
|
func isSleeping(k string) bool {
|
||||||
ipAndPort := strings.Split(k, ":")
|
ipAndPort := strings.Split(k, ":")
|
||||||
lastPing, ok := pingResponse[ipAndPort[0]]
|
|
||||||
// No ping response. Assume disconnected/sleeping device.
|
// 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
|
return true
|
||||||
}
|
}
|
||||||
if stratuxClock.Since(outSockets[k].LastUnreachable) < (5 * time.Second) {
|
if stratuxClock.Since(outSockets[k].LastUnreachable) < (5 * time.Second) {
|
||||||
|
|
Ładowanie…
Reference in New Issue