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:
James Rich 2026-03-22 00:42:27 -05:00 committed by GitHub
parent d136b162a4
commit c38bfc64de
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
76 changed files with 2220 additions and 1277 deletions

View file

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