]>
git.proxmox.com Git - proxmox-widget-toolkit.git/blob - data/UpdateQueue.js
1 // Serialize load (avoid too many parallel connections)
2 Ext
.define('Proxmox.data.UpdateQueue', {
5 constructor : function(){
13 var start_update = function() {
18 var storeid
= queue
.shift();
22 var info
= queue_idx
[storeid
];
23 queue_idx
[storeid
] = null;
25 info
.updatestart
= new Date();
29 callback: function(records
, operation
, success
) {
32 var runtime
= (new Date()).getTime() - info
.updatestart
.getTime();
33 info
.callback(runtime
, success
);
41 queue: function(store
, cb
) {
42 var storeid
= store
.storeid
;
44 throw "unable to queue store without storeid";
46 if (!queue_idx
[storeid
]) {
47 queue_idx
[storeid
] = {
55 unqueue: function(store
) {
56 var storeid
= store
.storeid
;
58 throw "unabel to unqueue store without storeid";
60 if (queue_idx
[storeid
]) {
61 Ext
.Array
.remove(queue
,storeid
);
62 queue_idx
[storeid
] = null;