gitoria

tracker

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit1f2df72a1f2df72amission RV39mre1f2df72a/lib/warm.hl

1.8 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. static warm = { running = false titles = false catalog = false people = false phase = '' rows = 0 startedAt = 0 readyAt = 0 }
  11. static warmRunning = () => { return warm.running }
  12. // what a page that needs `level` ('titles' | 'catalog' | 'all') may do: true = go ahead
  13. static warmReady = (level) => {
  14. if (!warm.running) { return true }
  15. if (level == 'titles') { return warm.titles }
  16. if (level == 'catalog') { return warm.catalog }
  17. return warm.people
  18. }
  19. // the writers that rely on the complete indexes (a duplicate title / person / short id otherwise) refuse until all is built
  20. static warmBlocked = () => { return warm.running && !warm.people }
  21. static warmSeconds = () => {
  22. if (warm.startedAt == 0) { return 0 }
  23. s = (now() - warm.startedAt) / 1000
  24. return s - s % 1
  25. }
  26. static warmText = () => {
  27. 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.'
  28. }

Branches

Latest commits

  • 1f2df72amission RV39mre
  • 6c1936f9log+status: GC planmre
  • 2846a840log: m569 result, GC hypothesismre
  • b24cd2d5log: Anton on hl:fetch, mission 569mre
  • 7d42cac1log+status: SL1 measured, fetch stalls remainmre
  • 8e5f2ceflog: SL1 deployedmre
  • 29f34212log: SL1 deploy startedmre
  • 529dd741Merge sl1-slices: slice details repair and person fill (SL1)mre
  • 8a83316blog: SL1 result, session drain slowermre
  • 35e93e8dSL1: slice the details repair and person fill: catalog lists changed in place, 40 ms fill steps, people created in steps, writes one table per tickmre
  • 72c9119flog+status: SL1 startedmre
  • d74620fcmission SL1: slice repair and person fillmre
  • 5d542d73log+status: ST1 resultmre
  • 3945eb81ST1: stall diagnosis reportmre
  • 404733aclog: ST1 startedmre
  • 3e3d5a55mission ST1: stall diagnosismre
  • 9c3180eblog+status: RV28d measured after deploymre
  • fdf10b1alog: RV28d deployed on day38bmre
  • 320005e9log: RV28d merged, deploy runningmre
  • a8fef27dRV28d: reportmre