Whenever adding something to a queue, include a timeout

No more wedged queues!

FREEBIE
This commit is contained in:
Scott Nonnenberg 2017-07-19 12:05:24 -07:00
parent cc2c3edaa6
commit 9db0a58260
10 changed files with 243 additions and 27 deletions

View file

@ -411,7 +411,10 @@
queueJob: function(callback) {
var previous = this.pending || Promise.resolve();
var current = this.pending = previous.then(callback, callback);
var taskWithTimeout = textsecure.createTaskWithTimeout(callback, 'conversation ' + this.id);
var current = this.pending = previous.then(taskWithTimeout, taskWithTimeout);
current.then(function() {
if (this.pending === current) {