perf: optimize import batch performance with caching + validation

Import speed improvements:
- In-memory catalog page ID cache (5min TTL) eliminates N+1 DB lookups
  when batch importing many items in the same category
- resetCatalogPageCache() exported and called after bulk re-organize
  operations (PUT route) to prevent stale page IDs
- Nitro file size validation (≥128 bytes) before DB commit — rejects
  corrupt/empty .nitro files that would break the client
- batchLookupByClassnames now uses Promise.all for parallel cache lookups
  instead of sequential awaits (10x faster for 50+ items)
- Auto-cleanup of corrupt nitro files on validation failure
This commit is contained in:
openhands committed 2026-08-06 20:27:06 +02:00
1 parent a1775fbf1e
commit aee099339c
3 files changed
+76 -14

No files matched your search

File diff suppressed because it is too large. Load diff