Use median to determine smart update interval (#2251)
Co-authored-by: AntsyLich <59261191+AntsyLich@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
84aa07b7f0
commit
d60241690b
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user