code wiki / _hdl_build / nx_galx_thumb_prewarm.nx
nx_galx_thumb_prewarm.nx
buildroot/runtime/_hdl_build/nx_galx_thumb_prewarm.nx
about
nx_galx_thumb_prewarm.nx -- pre-warm the gallery thumbnail cache so thumbs are INSTANT from the first
scroll instead of generated on demand. Reads a cid->path map (galx_cid_paths.tsv format: <cid>\t<path>),
and for each not-yet-cached cid runs nx_galx_thumb(src -> <thumbsdir>/<cid>.jpg). IDEMPOTENT + RESUMABLE
(skips cids whose thumb already exists), bounded fork-POOL for throughput. Runs NAS-side (where the images
+ the gallery's thumbs/ live); the on-demand /thumb route remains the fallback for anything not pre-warmed.
usage: nx_galx_thumb_prewarm <cid_paths.tsv> <thumbs_dir> <nx_galx_thumb.elf> [maxdim=384] [conc=4] [limit=0]
expect_exit: 0 . license_tier: ORIGINAL
dependencies 1 imports · 0 importers
imports: nx_syscalls.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 10 | const K_MAGIC_2048: i64 = 2048 |
functions
| 12 | func pw_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 } |
| 13 | func pw_putn(v: i64) -> i64 |
| 19 | func pw_atoi(s: *u8) -> i64 { var v: i64 = 0; var i: i64 = 0; while s[i] != (0 as u8) { let c: i64 = s[i] as i64; if c < 48 { return v } if c > 57 { return v } v = v * 10 + (c - 48); i = i + 1 } return v } called by 1: main |
| 20 | func pw_exists(path: *u8) -> i64 { let fd: i64 = sys_openat_rd(path); if fd < 0 { return 0 } sys_close(fd); return 1 } |
| 22 | func main(argc: i64, argv: *i64) -> i64 |