Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Projets publics
Ravada-Mirror
Commits
dfb065dc
Commit
dfb065dc
authored
Dec 30, 2021
by
Francesc Guasch
Browse files
refactor(frontend); try ping backend for 2 minutes
fixes #1665
parent
f3fece75
Changes
3
Hide whitespace changes
Inline
Side-by-side
lib/Ravada/WebSocket.pm
View file @
dfb065dc
...
...
@@ -267,7 +267,7 @@ sub _list_recent_requests($rvd, $seconds) {
}
sub
_ping_backend
($rvd, $args) {
my
@reqs
=
_list_recent_requests
(
$rvd
,
20
);
my
@reqs
=
_list_recent_requests
(
$rvd
,
1
20
);
my
$requested
=
scalar
(
grep
{
$_
->
{
status
}
eq
'
requested
'
}
@reqs
);
...
...
public/js/admin.js
View file @
dfb065dc
...
...
@@ -311,7 +311,12 @@ ravadaApp.directive("solShowMachine", swMach)
ws
.
onmessage
=
function
(
event
)
{
var
data
=
JSON
.
parse
(
event
.
data
);
$scope
.
$apply
(
function
()
{
$scope
.
pingbe_fail
=
!
data
;
var
time1
=
new
Date
()
/
1000
;
if
(
time1
-
time0
>
120
)
{
$scope
.
pingbe_fail
=
!
data
;
}
else
{
$scope
.
pingbe_fail
=
false
;
}
});
}
};
...
...
@@ -436,6 +441,8 @@ ravadaApp.directive("solShowMachine", swMach)
$scope
.
new_name_duplicated
=
false
;
$scope
.
show_clones
=
{
'
0
'
:
false
};
$scope
.
show_machine
=
{
'
0
'
:
false
};
$scope
.
pingbe_fail
=
false
;
var
time0
=
new
Date
()
/
1000
;
};
function
usersPageC
(
$scope
,
$http
,
$interval
,
request
)
{
...
...
script/rvd_back
View file @
dfb065dc
...
...
@@ -223,6 +223,7 @@ sub do_start {
my
$ravada
=
Ravada
->
new
(
%CONFIG
);
_do_start_logging
();
$ravada
->
_clean_requests
('
ping_backend
');
# Ravada::Request->enforce_limits();
#Ravada::Request->refresh_vms();
...
...
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