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
962a7b82
Commit
962a7b82
authored
Oct 09, 2013
by
Dietmar Maurer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
UpdateQueue: add callback
So that we can queue new things after loading is done.
parent
4643f689
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
11 deletions
+22
-11
UpdateQueue.js
www/manager/data/UpdateQueue.js
+19
-9
UpdateStore.js
www/manager/data/UpdateStore.js
+3
-2
No files found.
www/manager/data/UpdateQueue.js
View file @
962a7b82
...
...
@@ -15,30 +15,40 @@ Ext.define('PVE.data.UpdateQueue', {
return
;
}
var
store
=
queue
.
shift
();
if
(
!
store
)
{
var
store
id
=
queue
.
shift
();
if
(
!
store
id
)
{
return
;
}
var
info
=
queue_idx
[
storeid
];
queue_idx
[
storeid
]
=
null
;
queue_idx
[
store
.
storeid
]
=
null
;
info
.
updatestart
=
new
Date
()
;
idle
=
false
;
store
.
load
({
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
)
{
if
(
!
store
.
storeid
)
{
queue
:
function
(
store
,
cb
)
{
var
storeid
=
store
.
storeid
;
if
(
!
storeid
)
{
throw
"
unable to queue store without storeid
"
;
}
if
(
!
queue_idx
[
store
.
storeid
])
{
queue_idx
[
store
.
storeid
]
=
store
;
queue
.
push
(
store
);
if
(
!
queue_idx
[
storeid
])
{
queue_idx
[
storeid
]
=
{
store
:
store
,
callback
:
cb
};
queue
.
push
(
storeid
);
}
start_update
();
}
...
...
www/manager/data/UpdateStore.js
View file @
962a7b82
...
...
@@ -18,8 +18,9 @@ Ext.define('PVE.data.UpdateStore', {
var
run_load_task
=
function
()
{
if
(
PVE
.
Utils
.
authOK
())
{
PVE
.
data
.
UpdateQueue
.
queue
(
me
);
PVE
.
data
.
UpdateQueue
.
queue
(
me
,
function
(
runtime
,
success
)
{
load_task
.
delay
(
config
.
interval
,
run_load_task
);
});
}
else
{
load_task
.
delay
(
200
,
run_load_task
);
}
...
...
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