reduce expiration time for neighbor reports and device metrics

This commit is contained in:
root 2024-06-13 15:30:29 +00:00
parent bf66ece307
commit eb1e4bf3fb

View file

@ -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)