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

Stefan Priebe - Profihost AG s.priebe at profihost.ag
Tue Oct 8 07:26:55 CEST 2013


Am 08.10.2013 06:33, schrieb Dietmar Maurer:
> 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);
> 		})
> 	....

So you mean to skip the patch the first patch and put the calculation
into the UpdateStore.js?

Stefan

>> -----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