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
- 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
- b9c7c3c8Merge branch 'records-dp74' into mainTracker
- 85cfb4ae|||PR records: AP61 day61, DP74 liveTracker
- b1496147Merge branch 'ap61' into mainTracker
- 2047955bMerge branch 'u12-gateports' into mainTracker
- c8da40f3|||PR AP61: re-vendor Hybriel set day61 (source a05af47c, bin a11042e5)Tracker
- 4e018678|||PR deploy.sh: gates use Tracker's ports 8716-8719 and LC_ALL=C; README: 2 backups keptTracker
- 0b86324aMerge branch 'records-dp73' into mainTracker
- 9ce5f59b|||PR records: DP73 live 613ae0e; deploy.sh keeps 2 backupsTracker
- 613ae0ecMerge branch 'bs3' into mainTracker
- 1383264b|||PR BS3: keep shared synchronous sorting fastTracker
- 63e5ba1a|||PR BS3: guard boot imports and share resumable sort buffersTracker
- 310613f1Merge branch 'records-dp72' into mainTracker
- 6f7b61ba|||PR records: deploy-swap fix live, Kunibert findingsTracker
- c41587d2Merge branch 'bs2' into mainTracker