[pve-devel] [PATCH 2/2] dynamically adjust interval based on last runtime

Stefan Priebe s.priebe at profihost.ag
Mon Oct 7 08:28:05 CEST 2013


---
 www/manager/data/UpdateStore.js |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/www/manager/data/UpdateStore.js b/www/manager/data/UpdateStore.js
index ee02cd2..d977e98 100644
--- a/www/manager/data/UpdateStore.js
+++ b/www/manager/data/UpdateStore.js
@@ -18,10 +18,14 @@ Ext.define('PVE.data.UpdateStore', {
 
 	var run_load_task = function() {
 	    if (PVE.Utils.authOK()) {
+		var interval = config.interval;
+		if (me.updateruntime) {
+		    interval = config.interval + (me.updateruntime*2);
+		}
 		PVE.data.UpdateQueue.queue(me);
-		load_task.delay(config.interval, run_load_task);
+		load_task.delay(interval, run_load_task);
 	    } else {
-		load_task.delay(200, run_load_task);
+		load_task.delay(1000, run_load_task);
 	    }
 	};
 
-- 
1.7.10.4




More information about the pve-devel mailing list