move internal buildNewOnionPaths function into buildNewOnionPathsWorker per review

pull/1171/head
Ryan Tharp 5 years ago
parent db36067503
commit a905703cb4

@ -408,10 +408,7 @@ class LokiSnodeAPI {
});
}
async buildNewOnionPaths() {
// Note: this function may be called concurrently
return primitives.allowOnlyOneAtATime('buildNewOnionPaths', async () => {
async buildNewOnionPathsWorker() {
const _ = window.Lodash;
log.info('LokiSnodeAPI::buildNewOnionPaths - building new onion paths');
@ -489,7 +486,11 @@ class LokiSnodeAPI {
}
log.info(`Built ${this.onionPaths.length} onion paths`, this.onionPaths);
});
}
async buildNewOnionPaths() {
// this function may be called concurrently make sure we only have one inflight
return primitives.allowOnlyOneAtATime('buildNewOnionPaths', this.buildNewOnionPathsWorker);
}
async getRandomSnodeAddress() {

Loading…
Cancel
Save