code wiki / _hdl_build / nx_galx_thumb_prewarm.nx

nx_galx_thumb_prewarm.nx

buildroot/runtime/_hdl_build/nx_galx_thumb_prewarm.nx

5612 B92 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind tooltopic galx
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_galx_thumb_prewarm.nx

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

main pw_puts sys_write pw_atoi sys_mmap sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close pw_exists sys_openat_rd ↻ sys_close ↻ sys_wait4 sys_fork sys_execve sys_exit pw_putn sys_mmap ↻ sys_write ↻

structs

none

consts

10const K_MAGIC_2048: i64 = 2048

functions

12func 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 }
called by 1: main calls 1: sys_write
13func pw_putn(v: i64) -> i64
called by 1: main calls 2: sys_mmapsys_write
19func 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
20func pw_exists(path: *u8) -> i64 { let fd: i64 = sys_openat_rd(path); if fd < 0 { return 0 } sys_close(fd); return 1 }
called by 1: main calls 2: sys_openat_rdsys_close
22func main(argc: i64, argv: *i64) -> i64