fix: Avoid unnecessary call if earlierCounter is negative

This commit is contained in:
Myzel394 2023-12-31 17:56:41 +01:00
parent 69b76a7640
commit b707681a63
No known key found for this signature in database
GPG Key ID: 79CC92F37B3E1A2B

View File

@ -73,9 +73,14 @@ abstract class IntervalRecorderService<I, B : BatchesFolder> :
val timeMultiplier = settings.maxDuration / settings.intervalDuration
val earliestCounter = counter - timeMultiplier
if (earliestCounter <= 0) {
return
}
batchesFolder.deleteOldRecordings(earliestCounter)
}
// TODO
abstract class Settings(
open val maxDuration: Long,
open val intervalDuration: Long,