[pve-devel] [PATCH manager 1/7] ext6migrate: add unqueue to UpdateQueue

Dominik Csapak d.csapak at proxmox.com
Fri Mar 11 15:57:28 CET 2016


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 at proxmox.com>
---
 www/manager6/data/UpdateQueue.js | 10 ++++++++++
 www/manager6/data/UpdateStore.js |  2 ++
 2 files changed, 12 insertions(+)

diff --git a/www/manager6/data/UpdateQueue.js b/www/manager6/data/UpdateQueue.js
index 121aba6..d8c2798 100644
--- a/www/manager6/data/UpdateQueue.js
+++ b/www/manager6/data/UpdateQueue.js
@@ -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;
+		}
 	    }
 	});
     }
diff --git a/www/manager6/data/UpdateStore.js b/www/manager6/data/UpdateStore.js
index 72683fe..7208a4f 100644
--- a/www/manager6/data/UpdateStore.js
+++ b/www/manager6/data/UpdateStore.js
@@ -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);
 	});
     }
 });
-- 
2.1.4





More information about the pve-devel mailing list