put lock around buildNewOnionPaths since it's called multiple times

pull/1171/head
Ryan Tharp 5 years ago
parent 54ee9e3ad4
commit e2d5d9e793

@ -416,11 +416,10 @@ class LokiSnodeAPI {
});
}
// FIXME: need a lock because it is being called multiple times in parallel
async buildNewOnionPaths() {
// Note: this function may be called concurrently, so
// might consider blocking the other calls
// Note: this function may be called concurrently
return primitives.allowOnlyOneAtATime('buildNewOnionPaths', async () => {
const _ = window.Lodash;
log.info('LokiSnodeAPI::buildNewOnionPaths - building new onion paths');
@ -497,6 +496,7 @@ class LokiSnodeAPI {
}
log.info(`Built ${this.onionPaths.length} onion paths`, this.onionPaths);
});
}
async getRandomSnodeAddress() {

Loading…
Cancel
Save