gitoria

tracker

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commitb35f53e1b35f53e1log: DP62 stale runtime decisionmreb35f53e1/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

  • b35f53e1log: DP62 stale runtime decisionmre
  • f9593602log: Apollo deploy rule correctionmre
  • 3c95f7f3log: DP62 and HM63 startedmre
  • 9c4397c9mission HM63mre
  • 8dfe42c8mission DP62mre
  • e347fef4Merge rv44: tracker#61 #62 on Hybriel day44mre
  • 8274bcf1log: RV44 done, deploy held for the usage windowmre
  • 1ef7a3b1RV44: report day44 gates and migration/restart proofsmre
  • a5f62f6cRV44: re-vendor Hybriel set day44 (source 222edef7, bin 4f0f263e)mre
  • 6159a248Merge branch 'hm62-personindex' into rv44mre
  • a8923d93log: RV44 startedmre
  • cf28cf77mission RV44mre
  • 585782dfLog: tracker#60 Chrome look, STATUS rewrittenmre
  • 147d0172conductor: caramboleyo is the user, not owner/creatorApollo
  • 21dd0cfblog: #60 live measurement, reviewmre
  • 7793cf94HM62b report: person indexes with fixed mpackdbmre
  • b4c8d3a9Document tracker#62 fixed-index migration and GC proofmre
  • 09d66ed5status: #60 livemre
  • 4171672flog: #60 livemre
  • f52862a2log: HM62b startedmre