Use median to determine smart update interval (#2251)

Co-authored-by: AntsyLich <59261191+AntsyLich@users.noreply.github.com>
This commit is contained in:
Matthias Ahouansou
2025-07-10 14:36:31 +01:00
committed by GitHub
parent 84aa07b7f0
commit d60241690b
3 changed files with 7 additions and 8 deletions
@@ -125,11 +125,11 @@ class FetchIntervalTest {
}
@Test
fun `returns interval of 1 day when chapters are released just below every 2 days`() {
fun `returns interval of 2 days when chapters are released just below every 2 days`() {
val chapters = (1..20).map {
chapterWithTime(chapter, (43 * it).hours)
}
fetchInterval.calculateInterval(chapters, testZoneId) shouldBe 1
fetchInterval.calculateInterval(chapters, testZoneId) shouldBe 2
}
private fun chapterWithTime(chapter: Chapter, duration: Duration): Chapter {