mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-08 17:06:15 -08:00
Each chunk in a bulk insert/update/delete loop was running as its own implicit transaction, triggering one WAL commit (and one fsync, even with synchronous=NORMAL) per chunk-internal statement. Wrap each chunk in a single Drizzle transaction so the chunk commits as a unit. Per-chunk transactions (not whole-loop) preserves: - Cancellation between chunks via checkpointOperation() - Async progress reporting via reportOperationProgress() - Bounded write-lock duration (no minutes-long single transaction) Sites updated: - content.operations.ts: Xtream content bulk insert + clearXtreamImportCache deletes - playlist.operations.ts: upsertAppPlaylists loop + cascade delete chunks - favorites.operations.ts: reorderGlobalFavorites nested update loop - xtream.operations.ts: cascade content/category deletes + favorites/recently-viewed restore Highest impact: Xtream content imports (10k-100k+ rows) and M3U playlist upserts. EPG worker already used transactions correctly — unchanged. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Entire-Checkpoint: 3d6901072049