tracker
All repositories: gitoria
2.8 KB
// tests/seed-pager.hl — GATE FIXTURE for tracker.worldapi.org#38 (mission 033, tests/pager.mjs): every paginated list with 11// pages of 24, so the pagination shows "…" and its list changes length from click to click (what tracker#38 needed to show):// 250 movies 'Pg Movie 001'…'250' (released 1801…2050, genre Pagerg) → /movies, /genres/Pagerg (newest first: 250 … 001)// 250 series 'Pg Series 001'…'250' (kind series, released 1801…2050) → /series (newest first)// 250 shows 'Pg Show 001'…'250' (kind show, genre Talk, 1801…2050) → /shows (newest first)// 250 people 'Pgperson 001'…'250' (updatedAt 1001…1250) → /people (last updated first: 250 … 001)// Written into the gate's own empty storage before the server starts; self-assigned ids, one put() each.import { MPackDB } from 'hl:mpackdb'import { env } from 'hl:proc'storageDir = env('TRACKER_STORAGE')if (storageDir == null || !storageDir.startsWith('/')) { hlError('set TRACKER_STORAGE, absolute') }genresTable = new MPackDB(file = storageDir + '/genres.db', primaryKey = '@id', indexes = ['!oldId'])personsTable = new MPackDB(file = storageDir + '/persons.db', primaryKey = '@id', indexes = ['!oldId'])showsTable = new MPackDB(file = storageDir + '/shows.db', primaryKey = '@id', indexes = ['!oldId'])genreId = 'pg00000000000gp1'talkId = 'pg00000000000gt1'genresTable.put({ id = genreId name = 'Pagerg' urlSegment = 'Pagerg' tmdbId = 99001 oldId = 'pg-pagerg' })genresTable.put({ id = talkId name = 'Talk' urlSegment = 'Talk' tmdbId = 10767 oldId = 'pg-talk' })title = (id, name, type, kind, year, slug, genres) => {showsTable.put({adult = false id = id title = name summary = null tmdbSummary = null tmdbId = null kind = kindlanguage = 'en' type = type release = year + '-01-01' year = year image = null urlSegment = slugepisodesCount = null homepage = null imdbId = null seasonsCount = null status = null tagline = nulltvdbId = null tvmzId = null genres = genres cast = [] seasons = [] oldId = id})return true}let i = 1while (i <= 250) {let nnn = i < 10 ? '00' + i : (i < 100 ? '0' + i : '' + i)let y = 1800 + ititle('pgm00000000' + nnn, 'Pg Movie ' + nnn, 'movie', null, y, 'pg-movie-' + nnn, [genreId])title('pgs00000000' + nnn, 'Pg Series ' + nnn, 'series', 'series', y, 'pg-series-' + nnn, [])title('pgt00000000' + nnn, 'Pg Show ' + nnn, 'series', 'show', y, 'pg-show-' + nnn, [talkId])personsTable.put({ id = 'pgp00000000' + nnn name = 'Pgperson ' + nnn urlSegment = 'Pgperson-' + nnn updatedAt = 1000 + i tmdbId = null shows = [] oldId = 'pgp' + nnn })i = i + 1}genresTable.persist()showsTable.persist()personsTable.persist()console.log('seed-pager: 250 movies, 250 series, 250 shows, 250 people')
Branches
Latest commits
- 498bf644log: CB gates startmre
- 6ea2c6d6log: morning re-measure 11-04mre
- 446290f0log: GC1 livemre
- 8e6aa91dlog: GC1 deploy retrymre
- 87ad2dc1log: GC1 deployingmre
- 53f10fb8Merge branch 'gc1-deploy'mre
- 7fcbf1d2log: GC1 deploy GOmre
- 1fb6664bcompose: TRACKER_QSTATS=1 (GC1 measurement)mre
- 6576c1cdgc1: release the people-view scan lists once the view is builtmre
- 94f8a373gc1: back out the kept episode-id set (no measurable gain on /my/unwatched: 4.69 -> 4.61 GB per 150 loads)mre
- a1a88bd4gc1: search skips the stale-key string while no entry is stale; /my/unwatched asks a kept id set instead of building a key string per episode rowmre
- cd830744gc1: dbSearch: no split / map / list copy per candidate (scores from the stored text, top list touched only when the hit can enter)mre
- 451db7cdgc1: show page and check clicks read the kept watched set instead of building one from a by-value copy of every watchmre
- ddb4127egc1: TRACKER_QSTATS=1 logs queue and cache sizes every 10 s (measurement only)mre
- da60547fstatus: GC1 done, backup bugmre
- e4171021log: GC1 result, backup hard-link bugmre
- f1597214deploy.sh backup: tar --hard-dereference (hot tar stored mpackdb sidecars as hard links to .sessions files)mre
- 6b58571elog: GC windowmre
- 5c8baa1fdeploy lock: hold only around deploy.shmre
- b8dac822log: hybriel#309mre