Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid overloading ProviderChangedWorker with many changes
Change ProviderChangedWorker.enqueueChanged() to use unique work with REPLACE to ensure there's only at most one pending Worker waiting to execute. Add an initial delay to avoid cases where many of these Workers stack up due to their immediate launch. Changes handleProviderChange() to be more cautious on what enqueues it should be calling, avoiding cases where we could call both enqueuePeriodic() and enqueueNext(), which can lead to multiple calls to ProviderChangedWorker (as enqueuePeriodic() can cause work to immediately run).
- Loading branch information
1 parent
7217488
commit 196ee4b
Showing
1 changed file
with
29 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters