mirror of
https://github.com/meshtastic/firmware.git
synced 2026-01-20 00:37:36 +00:00
Compare commits
1 Commits
big-mesh
...
evicted-ag
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b056c405e6 |
@@ -2029,6 +2029,7 @@ meshtastic_NodeInfoLite *NodeDB::getOrCreateMeshNode(NodeNum n)
|
|||||||
}
|
}
|
||||||
// if we found a "boring" node, evict it
|
// if we found a "boring" node, evict it
|
||||||
if (oldestBoringIndex != -1) {
|
if (oldestBoringIndex != -1) {
|
||||||
|
evictedAge = sinceLastSeen(&meshNodes->at(oldestBoringIndex));
|
||||||
oldestIndex = oldestBoringIndex;
|
oldestIndex = oldestBoringIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2040,6 +2041,7 @@ meshtastic_NodeInfoLite *NodeDB::getOrCreateMeshNode(NodeNum n)
|
|||||||
(numMeshNodes)--;
|
(numMeshNodes)--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
LOG_WARN("Evicted node %u secs old", evictedAge);
|
||||||
// add the node at the end
|
// add the node at the end
|
||||||
lite = &meshNodes->at((numMeshNodes)++);
|
lite = &meshNodes->at((numMeshNodes)++);
|
||||||
|
|
||||||
|
|||||||
@@ -307,7 +307,10 @@ class NodeDB
|
|||||||
newStatus.notifyObservers(&status);
|
newStatus.notifyObservers(&status);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint32_t get_evicted_age() { return evictedAge; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
uint32_t evictedAge = UINT32_MAX;
|
||||||
bool duplicateWarned = false;
|
bool duplicateWarned = false;
|
||||||
bool localPositionUpdatedSinceBoot = false;
|
bool localPositionUpdatedSinceBoot = false;
|
||||||
uint32_t lastNodeDbSave = 0; // when we last saved our db to flash
|
uint32_t lastNodeDbSave = 0; // when we last saved our db to flash
|
||||||
|
|||||||
Reference in New Issue
Block a user