gitoria

tracker

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit6bb7c20e6bb7c20estatus: window 2026-11-09mre6bb7c20e/lib/warm.hl

2.1 KB

  1. // lib/warm.hl — THE START-UP STATE (mission T17, boot time): the server listens BEFORE the derived structures (public lists, slug maps,
  2. // search index, short ids, people view) are built; bootscan.hl builds them in time-boxed steps between requests. This is the one
  3. // place that says how far it is. `running` = a progressive start is under way (a module's lazy full-scan fallback must NOT run
  4. // then — it would block the server for minutes); the three flags turn true one after the other:
  5. // titles → the slug map (shows.hl), the titles' own derived data are in
  6. // catalog → titles + episodes: the public lists, the genre lists, the newest-episode dates (catalog.hl)
  7. // people → everything: search index, short ids (owners), person slug / TMDB maps, /people's order; the jobs start
  8. // A tool or a test that never starts the progressive scan has running = false: the modules' lazy builds work as before.
  9. import { now } from 'hl:time'
  10. import { Response } from 'hl:http1'
  11. static warm = { running = false titles = false catalog = false people = false phase = '' rows = 0 startedAt = 0 readyAt = 0 }
  12. static warmRunning = () => { return warm.running }
  13. // what a page that needs `level` ('titles' | 'catalog' | 'all') may do: true = go ahead
  14. static warmReady = (level) => {
  15. if (!warm.running) { return true }
  16. if (level == 'titles') { return warm.titles }
  17. if (level == 'catalog') { return warm.catalog }
  18. return warm.people
  19. }
  20. // the writers that rely on the complete indexes (a duplicate title / person / short id otherwise) refuse until all is built
  21. static warmBlocked = () => { return warm.running && !warm.people }
  22. static warmSeconds = () => {
  23. if (warm.startedAt == 0) { return 0 }
  24. s = (now() - warm.startedAt) / 1000
  25. return s - s % 1
  26. }
  27. static warmText = () => {
  28. 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.'
  29. }
  30. 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

  • 6bb7c20estatus: window 2026-11-09mre
  • 5db84974Log: Apollo window GO, AP56b started, BS1 copy removedmre
  • e84586a7Mission AP56bmre
  • 15917f03Record PR workflow rule (gitoria#50)mre
  • 942ac995status: paused workers statemre
  • 44b934e5log: respawn cleanupmre
  • 03a80097Log: Anton GC A/Bmre
  • c7cdef62Log: Apollo STOP, workers pausedmre
  • d0c083fbLog: usage stopmre
  • c6d464e5Log: Apollo GO backlog, AP56 and BS1 startedmre
  • 1eb6f1a1Missions AP56, BS1mre
  • 4871f8adLog: AP52 live on day52, browser gate greenmre
  • d9bf2988Merge ap52: day52, tracker#58 server argument, #51 modal close rule, #56 keyed season rowsmre
  • c4a60ef2Log: RT52 retest passed, AP52 startedmre
  • 83760a55Browser gate: search results belong to the address form of the typed text (tracker#52 navigate replace)mre
  • 6e951d91AP52: show-page rows are keyed records; closing a season is one upsert and removes (tracker#56, hybriel#331)mre
  • 3bb4ccddAP52: modal close button refers to its nested rule with Style.buttonModalX (tracker#51, hybriel#333)mre
  • ba16933fAP52: login callback and title route are static handlers taking the server as third argument (tracker#58, hybriel#332)mre
  • 85153900AP52: re-vendor Hybriel set day52 (source 77cfca31, bin 0a8ed496)mre
  • 7c051eddLog: hybriel#338 answermre