ext6migrate: add unqueue to UpdateQueue

in the event of a destroyed or stopped object/updateStore,
we do not want to execute queued requests, thus we
need to unqueue them

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak 2016-03-11 15:57:28 +01:00 committed by Dietmar Maurer
parent 95c4a0cb84
commit fd02b3c506
2 changed files with 12 additions and 0 deletions

View File

@ -51,6 +51,16 @@ Ext.define('PVE.data.UpdateQueue', {
queue.push(storeid);
}
start_update();
},
unqueue: function(store) {
var storeid = store.storeid;
if (!storeid) {
throw "unabel to unqueue store without storeid";
}
if (queue_idx[storeid]) {
Ext.Array.remove(queue,storeid);
queue_idx[storeid] = null;
}
}
});
}

View File

@ -42,6 +42,7 @@ Ext.define('PVE.data.UpdateStore', {
},
stopUpdate: function() {
load_task.cancel();
PVE.data.UpdateQueue.unqueue(me);
}
});
@ -49,6 +50,7 @@ Ext.define('PVE.data.UpdateStore', {
me.on('destroy', function() {
load_task.cancel();
PVE.data.UpdateQueue.unqueue(me);
});
}
});