tracker
All repositories: gitoria
2.1 KB
// lib/warm.hl — THE START-UP STATE (mission T17, boot time): the server listens BEFORE the derived structures (public lists, slug maps,// search index, short ids, people view) are built; bootscan.hl builds them in time-boxed steps between requests. This is the one// place that says how far it is. `running` = a progressive start is under way (a module's lazy full-scan fallback must NOT run// then — it would block the server for minutes); the three flags turn true one after the other:// titles → the slug map (shows.hl), the titles' own derived data are in// catalog → titles + episodes: the public lists, the genre lists, the newest-episode dates (catalog.hl)// people → everything: search index, short ids (owners), person slug / TMDB maps, /people's order; the jobs start// A tool or a test that never starts the progressive scan has running = false: the modules' lazy builds work as before.import { now } from 'hl:time'import { Response } from 'hl:http1'static warm = { running = false titles = false catalog = false people = false phase = '' rows = 0 startedAt = 0 readyAt = 0 }static warmRunning = () => { return warm.running }// what a page that needs `level` ('titles' | 'catalog' | 'all') may do: true = go aheadstatic warmReady = (level) => {if (!warm.running) { return true }if (level == 'titles') { return warm.titles }if (level == 'catalog') { return warm.catalog }return warm.people}// the writers that rely on the complete indexes (a duplicate title / person / short id otherwise) refuse until all is builtstatic warmBlocked = () => { return warm.running && !warm.people }static warmSeconds = () => {if (warm.startedAt == 0) { return 0 }s = (now() - warm.startedAt) / 1000return s - s % 1}static warmText = () => {return 'tracker is starting up: the lists, the search and the people are being built (' + warm.phase + ', ' + warmSeconds() + ' s so far). Reload this page in a minute or two.'}static startingUpText = () => { return new Response('tracker is starting up, try again in a minute', { status = 503 headers = { 'Retry-After' = '30' 'Content-Type' = 'text/plain; charset=utf-8' 'X-Content-Type-Options' = 'nosniff' } }) }
Branches
Latest commits
- d3179273log: HM65 hl:heap vendoringmre
- 89606a5cHM65 briefmre
- 096ce0d4log: DP69 live on day48mre
- b3d8a80bDP69 brief, RV48 mergedmre
- ce6d7d32Merge rv48: Hybriel day48mre
- 3da2ea86RV48: report day48 cold starts, gates and cleanupmre
- 8d9ecdfeRV48: re-vendor Hybriel set day48 (source b6a8f429, bin 660a9524)mre
- 4a802ae7status: RV48 runningmre
- 0a5412b6RV48 brief, day48 outmre
- 56665efelog: CB69 mergedmre
- 05448a98Merge cb69-imports: appTitle in a dependency-free topicmre
- e55b379dKeep shared app title independent of the route import graphmre
- 9a99659blog: hybriel#334, batch waits for day48mre
- 85fa6c9blog: CB68 result, CB69 startedmre
- 2f07c1b7log: DP68 boot gate failed, CB68mre
- 9652782dlog: HM59 merged, DP68 startedmre
- 29867a75Merge hm59-logic: tracker#59 page logic moved to libmre
- f7bfe90bMove remaining page builders into their topicsmre
- 7c3991f9log: day46 from Antonmre
- ec54fc35Move show page logic into the shows topicmre