]> git.proxmox.com Git - pve-manager.git/commitdiff
ext6migrate: add unqueue to UpdateQueue
authorDominik Csapak <d.csapak@proxmox.com>
Fri, 11 Mar 2016 14:57:28 +0000 (15:57 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Fri, 11 Mar 2016 15:32:47 +0000 (16:32 +0100)
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>
www/manager6/data/UpdateQueue.js
www/manager6/data/UpdateStore.js

index 121aba68e2042d6e68b54cb73fa7e486faa3260d..d8c27980b62c7ddf1e43844ef2352225bbf47d7f 100644 (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;
+               }
            }
        });
     }
index 72683fec70a513a1a0edeaf6e0d1997b7defd8b4..7208a4f8e69044011935962ab757ff06cb78c5b3 100644 (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);
        });
     }
 });