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

Dietmar Maurer dietmar at proxmox.com
Tue Oct 8 06:33:52 CEST 2013


Wouldn't it be simpler to add a callback which gets called after the load?

	    if (PVE.Utils.authOK()) {
		PVE.data.UpdateQueue.queue(me, function(success)  {
		      load_task.delay(config.interval, run_load_task);
		})
	....

> -----Original Message-----
> From: pve-devel-bounces at pve.proxmox.com [mailto:pve-devel-
> bounces at pve.proxmox.com] On Behalf Of Stefan Priebe
> Sent: Montag, 07. Oktober 2013 08:28
> To: pve-devel at pve.proxmox.com
> Subject: [pve-devel] [PATCH 2/2] dynamically adjust interval based on last
> runtime
> 
> ---
>  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
> 
> _______________________________________________
> pve-devel mailing list
> pve-devel at pve.proxmox.com
> http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel





More information about the pve-devel mailing list