+ expired status
This commit is contained in:
parent
503427031b
commit
13a8f58ab9
2
const.go
2
const.go
@ -20,5 +20,5 @@ const (
|
|||||||
TIMEOUT = 50 * time.Second
|
TIMEOUT = 50 * time.Second
|
||||||
|
|
||||||
// when is a peer considered gone forever? (could remove)
|
// when is a peer considered gone forever? (could remove)
|
||||||
EXPIRY_DAYS = 28
|
EXPIRY = 28 * time.Hour * 24
|
||||||
)
|
)
|
||||||
|
@ -88,6 +88,8 @@ func GenerateReport(dev *wgtypes.Device, conf *DsnetConfig, oldReport *DsnetRepo
|
|||||||
status = StatusOnline
|
status = StatusOnline
|
||||||
// TODO same test but with rx byte data from last report (otherwise
|
// TODO same test but with rx byte data from last report (otherwise
|
||||||
// peer can fake online status by disabling handshake)
|
// peer can fake online status by disabling handshake)
|
||||||
|
} else if !wgPeer.LastHandshakeTime.IsZero() && time.Since(wgPeer.LastHandshakeTime) > EXPIRY {
|
||||||
|
status = StatusExpired
|
||||||
} else {
|
} else {
|
||||||
status = StatusOffline
|
status = StatusOffline
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user