Closed Bug 1509267 Opened Last year Closed 8 months ago
Cleanup Remote Settings worker when inactive
47 bytes, text/x-phabricator-request
|Details | Review|
The operations that we moved to the worker are executed every time there a data change is published on the remote settings server. When nothing new is available, the synchronization is a no-op. So far, with the current number of collections, it's been only a couple of times a week (at most). I therefore think it makes sense to clean it up when inactive.
I think the best step here is probably to make the actual worker lazy, by providing a getter that lazily inits the worker inside your custom worker class. When this lazy initter runs it can setTimeout a call to clean the worker up (just calling _worker.terminate() if there are no outstanding messages). Alternatively, if the calling code knows that it is done using the worker, you could just explicitly destroy the worker then without resorting to a setTimeout.
Pushed by firstname.lastname@example.org: https://hg.mozilla.org/integration/autoland/rev/5765e6384ff1 Cleanup Remote Settings worker when inactive r=glasserc,dthayer
You need to log in before you can comment on or make changes to this bug.