mirror of
https://github.com/brianshea2/meshmap.net.git
synced 2024-11-09 23:24:09 -08:00
reduce expiration time for neighbor reports and device metrics
This commit is contained in:
parent
bf66ece307
commit
eb1e4bf3fb
|
@ -20,6 +20,8 @@ import (
|
|||
|
||||
const (
|
||||
NodeExpiration = 86400 // 1 day
|
||||
NeighborExpiration = 7200 // 2 hr
|
||||
MetricsExpiration = 7200 // 2 hr
|
||||
PruneWriteInterval = time.Minute
|
||||
)
|
||||
|
||||
|
@ -202,7 +204,7 @@ func main() {
|
|||
for {
|
||||
time.Sleep(PruneWriteInterval)
|
||||
NodesMutex.Lock()
|
||||
Nodes.Prune(NodeExpiration, NodeExpiration, NodeExpiration, NodeExpiration)
|
||||
Nodes.Prune(NodeExpiration, NeighborExpiration, MetricsExpiration, NodeExpiration)
|
||||
if len(dbPath) > 0 {
|
||||
valid := Nodes.GetValid()
|
||||
err := valid.WriteFile(dbPath)
|
||||
|
|
Loading…
Reference in a new issue