doFetchModBlockedList: don't block ui thread #7674

Merged
jessopb merged 2 commits from background-modBlockedList into master 2022-08-12 23:23:04 +02:00
jessopb commented 2022-08-12 19:01:04 +02:00 (Migrated from github.com)

doFetchModBlockedList is blocking the ui thread.

Duplicate data in doFetchModBlockedList::blockListsPerChannel to about 1000. The tab is dead when function hits, about 4s after reload.

  • Yield occasionally using the setTimeout method.

  • Doing a chunk size of 1 for now so we don't have to yield the inner loop as well (seems good enough). This is just based on a relatively large blocklist size.

  • Can't do await in a callback, so must change the forEach to a for.

doFetchModBlockedList is blocking the ui thread. Duplicate data in `doFetchModBlockedList::blockListsPerChannel` to about 1000. The tab is dead when function hits, about 4s after reload. - Yield occasionally using the `setTimeout` method. - Doing a chunk size of 1 for now so we don't have to yield the inner loop as well (seems good enough). This is just based on a relatively large blocklist size. - Can't do `await` in a callback, so must change the `forEach` to a `for`.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: LBRYCommunity/lbry-desktop#7674
No description provided.