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

Stefan Priebe - Profihost AG s.priebe at profihost.ag
Tue Oct 8 10:52:17 CEST 2013


Am 08.10.2013 10:44, schrieb Dietmar Maurer:
>> But right now there is no callback in:
>> PVE.data.UpdateQueue.queue
> 
> It is not very hard to add one ;-)

If you're familiar with JS it def. isn't ;-)

OK my idea would be to add a 2nd param cbf and pass it down to start_update:

      Ext.apply(me, {
            queue: function(store, cbf) {
                if (!store.storeid) {
                    throw "unable to queue store without storeid";
                }
                if (!queue_idx[store.storeid]) {
                    queue_idx[store.storeid] = store;
                    queue.push(store);
                }
                start_update(cbf);
            }
        });

But what todo in start_update with it as it might shift a diffeent queue
object.

So the only way i see would be to attach the cbf to the store object:

      Ext.apply(me, {
            queue: function(store, cbf) {
                if (!store.storeid) {
                    throw "unable to queue store without storeid";
                }
                if (!queue_idx[store.storeid]) {
		    store.cbf = cbf;
                    queue_idx[store.storeid] = store;
                    queue.push(store);
                }
                start_update();
            }
        });

And the to call it in start_update in the store.load callback. Is this
what you mean?

Stefan



More information about the pve-devel mailing list