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:
Jason Laster 2019-07-19 18:13:23 +00:00
Родитель e8e4790c10
Коммит f2c56f61e0
1 изменённых файлов: 8 добавлений и 11 удалений

Просмотреть файл

@ -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<*> {