Every new channel finished in the same round (build 88)
pauljd/davidson-ci: Davidson CI / quality (push) Failing after 2m26s
pauljd/davidson-ci: Davidson CI / ai-review (push) Failing after 4m54s
release-gate / verify (push) Successful in 10m36s

Paul, 1 December 2026: build 87 finished one new channel's list per round, about an hour apart (Wonder TV
08:24, Heroes Live 09:35, Horror TV 10:37 downstairs). Every channel still on its first read is now finished
in the same round, one after another, at setup's pace and within setup's hourly cap, then rebooked.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-12-01 12:02:45 +00:00
co-authored by Claude Opus 5.5
parent 946aff0164
commit ba282854fc
3 changed files with 15 additions and 9 deletions
+1 -1
View File
@@ -3,7 +3,7 @@ plugins {
id("org.jetbrains.kotlin.plugin.compose")
}
/** The release's build number: versionCode is this x 10 plus the edition's channel. */
val ORBIT_BUILD = 87
val ORBIT_BUILD = 88
android {
namespace = "tv.orbit.classic"
compileSdk = 36
@@ -13,8 +13,6 @@ internal const val POOL_REFRESH_MS = 7 * 24 * 60 * 60_000L
*/
internal const val POOL_JITTER_MS = 48 * 60 * 60_000L
internal const val POOL_ROUTINE_GAP_MS = 30 * 60_000L
/** A new channel's first read is finished in one go at most this often, so two never run at once ([ChannelScheduler.refreshStepwise]). */
internal const val FIRST_READ_FINISH_GAP_MS = 10 * 60_000L
internal fun poolJitterMs(number: Int): Long = (number.toLong() * 7_919L % 48L) * 60 * 60_000L
/** Whether a cached list is old enough for its routine refresh. */
internal fun poolRefreshDue(fetchedAtMs: Long, number: Int, nowMs: Long) = nowMs - fetchedAtMs >= POOL_REFRESH_MS + poolJitterMs(number)
@@ -84,8 +82,6 @@ internal class ChannelScheduler(private val store: ScheduleStore,
}
/** When this TV last made a routine (weekly) list refresh; at most one per [POOL_ROUTINE_GAP_MS]. */
@Volatile internal var lastRoutineRefreshMs = 0L
/** When a first read was last finished in one go ([refreshStepwise]): one channel at a time. */
@Volatile private var lastFirstReadFinishMs = 0L
/** The order routine refreshes go in: see [RoutineQueue]. */
internal val routineQueue = RoutineQueue()
/** Disk only and quick, so the guide and player agree from the first frame after a restart. */
@@ -436,10 +432,10 @@ internal class ChannelScheduler(private val store: ScheduleStore,
val refresh = PoolRefresh(programming, choices, cached.series, earlierFilms(loop))
val waiting = synchronized(refreshWaiting) { refreshWaiting.size + if (number in refreshWaiting) 0 else 1 }
// A new channel's first read (its pool has no signature yet) is finished in one go, at setup's pace and within setup's
// hourly cap, one channel at a time (Paul, 1 December 2026), so its week is booked from all its shows within minutes,
// not a fair share a round over days. Later refreshes go a fair share at a time as before.
val firstRead = cached.signature.isEmpty() && now - lastFirstReadFinishMs >= FIRST_READ_FINISH_GAP_MS
if (firstRead) lastFirstReadFinishMs = now
// hourly cap (Paul, 1 December 2026), so its week is booked from all its shows within minutes, not a fair share a round
// over days. Every new channel waiting is finished in the same round, one after another: setup's pacing keeps their
// requests a second apart however many there are. Later refreshes go a fair share at a time as before.
val firstRead = cached.signature.isEmpty()
val share = if (firstRead) Int.MAX_VALUE else refreshShare(BackgroundPacing.budget, BackgroundPacing.usedThisHour(), waiting)
val step = try {
if (firstRead) BackgroundPacing.asSetup {
+10
View File
@@ -0,0 +1,10 @@
# Build 88 (version code 880): change log
Build 87 plus the change below, on `horror-tv`.
## Every new channel finished in the same round (Paul, 1 December 2026)
- Build 87 finished one new channel's list per round, and rounds come about once an hour, so three new channels took three
hours downstairs (Wonder TV 08:24, Heroes Live 09:35, Horror TV 10:37). Now every channel still on its first read is
finished in the same round, one after another, at setup's pace (a request a second) and within setup's hourly cap, and
each is booked again with its whole list as soon as it's done.