зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1559547 - fix worker-scopes intermittent. r=bhackett
Differential Revision: https://phabricator.services.mozilla.com/D38533 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
e8e4790c10
Коммит
f2c56f61e0
|
@ -125,17 +125,14 @@ function forEachThread(iteratee) {
|
|||
// trigger additional thread operations. Requests on server threads will
|
||||
// resolve in FIFO order, and this could result in client and server state
|
||||
// going out of sync.
|
||||
const mainThreadPromise = iteratee(threadFront);
|
||||
const workerPromises = listWorkerThreadFronts().map(t => {
|
||||
try {
|
||||
iteratee(t);
|
||||
} catch (e) {
|
||||
// If a worker thread shuts down while sending the message then it will
|
||||
// throw. Ignore these errors.
|
||||
console.error(e);
|
||||
}
|
||||
});
|
||||
return Promise.all([mainThreadPromise, ...workerPromises]);
|
||||
|
||||
const promises = [threadFront, ...listWorkerThreadFronts()].map(
|
||||
// If a thread shuts down while sending the message then it will
|
||||
// throw. Ignore these exceptions.
|
||||
t => iteratee(t).catch(e => console.log(e))
|
||||
);
|
||||
|
||||
return Promise.all(promises);
|
||||
}
|
||||
|
||||
function resume(thread: string): Promise<*> {
|
||||
|
|
Загрузка…
Ссылка в новой задаче