Commit dfb065dc authored by Francesc Guasch's avatar Francesc Guasch
Browse files

refactor(frontend); try ping backend for 2 minutes

fixes #1665
parent f3fece75
......@@ -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, 120);
my $requested = scalar( grep { $_->{status} eq 'requested' } @reqs );
......
......@@ -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) {
......
......@@ -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();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment