[pve-devel] [PATCH manager] fix surviving update store

Fabian Grünbichler f.gruenbichler at proxmox.com
Thu Jul 7 08:23:00 CEST 2016


applied

On Mon, Jul 04, 2016 at 01:16:10PM +0200, Dominik Csapak wrote:
> when a load of an update store was ongoing and stopUpdate
> was called, the task could not be canceled, and the store
> would remain indefinitely
> 
> this patch sets 'isStopped' of the store on stopUpdate
> and checks it on the next update and stopping it then
> 
> Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
> ---
>  www/manager6/data/UpdateStore.js | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/www/manager6/data/UpdateStore.js b/www/manager6/data/UpdateStore.js
> index 7208a4f..6be3630 100644
> --- a/www/manager6/data/UpdateStore.js
> +++ b/www/manager6/data/UpdateStore.js
> @@ -10,6 +10,8 @@
>  Ext.define('PVE.data.UpdateStore', {
>      extend: 'Ext.data.Store',
>  
> +    isStopped: true,
> +
>      constructor: function(config) {
>  	var me = this;
>  
> @@ -26,6 +28,10 @@ Ext.define('PVE.data.UpdateStore', {
>  	var load_task = new Ext.util.DelayedTask();
>  
>  	var run_load_task = function() {
> +	    if (me.isStopped) {
> +		return;
> +	    }
> +
>  	    if (PVE.Utils.authOK()) {
>  		PVE.data.UpdateQueue.queue(me, function(runtime, success) {
>  		    var interval = config.interval + runtime*2;
> @@ -38,9 +44,11 @@ Ext.define('PVE.data.UpdateStore', {
>  
>  	Ext.apply(config, {
>  	    startUpdate: function() {
> +		me.isStopped = false;
>  		run_load_task();
>  	    },
>  	    stopUpdate: function() {
> +		me.isStopped = true;
>  		load_task.cancel();
>  		PVE.data.UpdateQueue.unqueue(me);
>  	    }
> -- 
> 2.1.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