Improve queuing strategies in the app

This commit is contained in:
Scott Nonnenberg 2019-07-09 11:46:48 -07:00
parent 7b645011c2
commit cb2c691667
6 changed files with 85 additions and 131 deletions

View file

@ -327,10 +327,11 @@
});
},
queueTask(task) {
this.pendingQueue =
this.pendingQueue || new window.PQueue({ concurrency: 1 });
const taskWithTimeout = textsecure.createTaskWithTimeout(task);
this.pending = this.pending.then(taskWithTimeout, taskWithTimeout);
return this.pending;
return this.pendingQueue.add(taskWithTimeout);
},
cleanSignedPreKeys() {
const MINIMUM_KEYS = 3;