Assign stream ids and save the ids file in slices too #51
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/ids-sliced"
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?
Follow-up to #50. In the live log after #50, the deferred view rebuilds still blocked 0.7 s now and then (stream id assignment after a big provider refresh), and the ids file save 5 s later blocked about 0.5 s.
XtreamIds.assignStepsis the assignment as a generator.assignStreamsruns it in one go;assignStreamsSlicedruns it in slices, one assignment at a time. A one-go call finishes a sliced one in progress first, so the two never mix their changes to the state. Both return the last result when asked again for the same channel list (each login's view used to redo it).buildViewSlicedtakes the pool's channels and guide once at the start and assigns ids with the sliced assignment.stateJson, the same JSON asJSON.stringify) and written withfs.promises. Saves never overlap.flush()still writes in one go.On the real pool, deployed (#50) vs this branch, with identical views, id state and ids file every time:
Tests: 148/148 pass.