tracker
All repositories: gitoria
1.6 KB
// tests/photoqueue.hl — mission 046: the sliced photo queue (people.hl photoQueueStart/Step) must equal the former one-shot photoQueue// (inlined below, verbatim) — same ids, same order. On a store copy (app stopped). TRACKER_PHOTOQ_MARK=1 first marks every 3rd person// (photoCheck) and every 5th (tmdbProfile) so the predicate has both outcomes; TRACKER_SLICE_MS=0 forces many ticks.import { env } from 'hl:proc'import { now } from 'hl:time'import { personsTable } from '../lib/shows.hl'import { peopleView, peopleViewCurrent, needsPhoto, photoQueueStart, photoQueueStep } from '../lib/people.hl'oldQueue = () => {peopleViewCurrent()out = []for (id of peopleView.ids) {let p = personsTable.fetch(id)if (p != null && needsPhoto(&p)) { out.push(id) }}return out}if (env('TRACKER_PHOTOQ_MARK') == '1') {i = 0for (p of personsTable.find(null, null)) {x = pif (i % 3 == 0) { x.photoCheck = 'TMDB has none' } else if (i % 5 == 0) { x.tmdbProfile = '/x.jpg' }personsTable.update(x.id, x)i = i + 1}}t0 = now()a = env('TRACKER_PHOTOQ_NOOLD') == '1' ? [] : oldQueue()t1 = now()c = photoQueueStart()maxTick = 0while (true) {s = now()done = photoQueueStep(&c)d = now() - sif (d > maxTick) { maxTick = d }if (done) { break }}b = c.outconsole.log('new queue built: ' + b.length)same = a.length == b.lengthi = 0while (same && i < a.length) { if (a[i] != b[i]) { same = false } i = i + 1 }console.log('people ' + peopleView.ids.length + ' old=' + a.length + ' (' + (t1 - t0) + ' ms one block) new=' + b.length + ' ticks=' + c.steps + ' skipped=' + c.skipped + ' scanMs=' + c.ms + ' maxTickMs=' + maxTick)console.log(same ? 'SAME ORDER AND IDS' : 'DIFFERENT')
Branches
Latest commits
- d2e6d26bMerge branch 'records-park55' into mainTracker
- f567f025|||PR records: park #55, no Claude workers ruleTracker
- c21aff6bMerge branch 'records-hm55c' into mainTracker
- 9ba258d3|||PR records: HM55b resultTracker
- 64f2d300Merge branch 'records-hm55b2' into mainTracker
- ae3b80dc|||PR records: HM55b briefTracker
- 7ef3cb3bMerge branch 'records-st55' into mainTracker
- fec2e080|||PR records: STATUS HM55Tracker
- 8e174918Merge branch 'records-hm55b' into mainTracker
- b1ecee57|||PR records: HM55 stateTracker
- 28eab08cMerge branch 'records-hm55' into mainTracker
- d3edaa05|||PR records: HM55 start, PROCEDURES.mdTracker
- 3059f86cMerge branch 'records-design-rule' into mainTracker
- 421a4809|||PR records: his-design rule (Apollo 2026-11-13)Tracker
- d1390692Merge branch 'records-dp75b' into mainTracker
- a4d1a7d2|||PR records: later steps checked, branch auditTracker
- e070e16fMerge branch 'records-dp75' into mainTracker
- 642b4fa8|||PR records: DP75 day62 live, AP62 briefTracker
- bfc4ea4dMerge branch 'ap62' into mainTracker
- 2c95ac46|||PR AP62: re-vendor Hybriel set day62 (source 70341ad2, bin a54f5f08)Tracker