mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
Refactor command handling, enhance tests, and improve discovery logic (#4878)
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
This commit is contained in:
parent
d136b162a4
commit
c38bfc64de
76 changed files with 2220 additions and 1277 deletions
|
|
@ -30,7 +30,11 @@ constructor(
|
|||
private val radioController: RadioController,
|
||||
) {
|
||||
/** Identifies nodes that match the cleanup criteria. */
|
||||
suspend fun getNodesToClean(olderThanDays: Float, onlyUnknownNodes: Boolean, currentTimeSeconds: Long): List<Node> {
|
||||
open suspend fun getNodesToClean(
|
||||
olderThanDays: Float,
|
||||
onlyUnknownNodes: Boolean,
|
||||
currentTimeSeconds: Long,
|
||||
): List<Node> {
|
||||
val sevenDaysAgoSeconds = currentTimeSeconds - 7.days.inWholeSeconds
|
||||
val olderThanTimestamp = currentTimeSeconds - olderThanDays.toInt().days.inWholeSeconds
|
||||
|
||||
|
|
@ -49,7 +53,7 @@ constructor(
|
|||
}
|
||||
|
||||
/** Performs the cleanup of specified nodes. */
|
||||
suspend fun cleanNodes(nodeNums: List<Int>) {
|
||||
open suspend fun cleanNodes(nodeNums: List<Int>) {
|
||||
if (nodeNums.isEmpty()) return
|
||||
|
||||
nodeRepository.deleteNodes(nodeNums)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue