Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pve-manager
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
pve-manager
Commits
fd52f4af
Commit
fd52f4af
authored
Apr 27, 2015
by
Dietmar Maurer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
copy UpdateQueue.js from manager to manager5
parent
efb56841
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
57 additions
and
0 deletions
+57
-0
UpdateQueue.js
www/manager5/data/UpdateQueue.js
+57
-0
No files found.
www/manager5/data/UpdateQueue.js
0 → 100644
View file @
fd52f4af
// Serialize load (avoid too many parallel connections)
Ext
.
define
(
'
PVE.data.UpdateQueue
'
,
{
singleton
:
true
,
constructor
:
function
(){
var
me
=
this
;
var
queue
=
[];
var
queue_idx
=
{};
var
idle
=
true
;
var
start_update
=
function
()
{
if
(
!
idle
)
{
return
;
}
var
storeid
=
queue
.
shift
();
if
(
!
storeid
)
{
return
;
}
var
info
=
queue_idx
[
storeid
];
queue_idx
[
storeid
]
=
null
;
info
.
updatestart
=
new
Date
();
idle
=
false
;
info
.
store
.
load
({
callback
:
function
(
records
,
operation
,
success
)
{
idle
=
true
;
if
(
info
.
callback
)
{
var
runtime
=
(
new
Date
()).
getTime
()
-
info
.
updatestart
.
getTime
();
info
.
callback
(
runtime
,
success
);
}
start_update
();
}
});
};
Ext
.
apply
(
me
,
{
queue
:
function
(
store
,
cb
)
{
var
storeid
=
store
.
storeid
;
if
(
!
storeid
)
{
throw
"
unable to queue store without storeid
"
;
}
if
(
!
queue_idx
[
storeid
])
{
queue_idx
[
storeid
]
=
{
store
:
store
,
callback
:
cb
};
queue
.
push
(
storeid
);
}
start_update
();
}
});
}
});
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment