Merge the pool's providers in a worker thread #47
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/merge-worker"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
After #46 a merge still blocked requests for 2 to 5 s after each provider refresh. The planning (naming streams, grouping them into channels, dropping misfiled guide ids, ordering each channel's streams) now runs in a worker thread. The main thread sends each changed provider's names, categories and guide ids, gets back channel keys and a compact plan (an Int32Array, transferred), and builds the channels in slices of 2,000 that yield to requests. Channels whose streams, guide and catch-up are unchanged are reused as before, merges never overlap, and a failed worker falls back to merging on the main thread.
Checked in the live container against the real 15 providers (295k streams, 161,669 channels): identical channels to the current merge on the first merge and after happy8k and sonymax refreshes (0 differences). Longest main-thread block: 75-80 ms for an unchanged merge or a small refresh, 533 ms for the first merge at startup (was 12.6 s). 143 tests pass.