when a load of an update store was ongoing and stopUpdate
was called, the task could not be canceled, and the store
would remain indefinitely
this patch sets 'isStopped' of the store on stopUpdate
and checks it on the next update and stopping it then
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Ext.define('PVE.data.UpdateStore', {
extend: 'Ext.data.Store',
+ isStopped: true,
+
constructor: function(config) {
var me = this;
var load_task = new Ext.util.DelayedTask();
var run_load_task = function() {
+ if (me.isStopped) {
+ return;
+ }
+
if (PVE.Utils.authOK()) {
PVE.data.UpdateQueue.queue(me, function(runtime, success) {
var interval = config.interval + runtime*2;
Ext.apply(config, {
startUpdate: function() {
+ me.isStopped = false;
run_load_task();
},
stopUpdate: function() {
+ me.isStopped = true;
load_task.cancel();
PVE.data.UpdateQueue.unqueue(me);
}