Commit 98d903c2 authored by Francesc Guasch's avatar Francesc Guasch
Browse files

[#66] fixed front fast ping backend

parent 40548802
......@@ -37,6 +37,7 @@ our $TIMEOUT = 5;
our @VM_TYPES = ('KVM');
our %VM;
our $PID_FILE_BACKEND = '/var/run/rvd_back.pl.pid';
=head2 BUILD
......@@ -256,6 +257,8 @@ Return true if alive, false otherwise.
sub ping_backend {
my $self = shift;
return 1 if $self->_ping_backend_localhost();
my $req = Ravada::Request->ping_backend();
$self->wait_request($req, 2);
......@@ -263,6 +266,13 @@ sub ping_backend {
return 0;
}
sub _ping_backend_localhost {
my $self = shift;
return 1 if -e $PID_FILE_BACKEND;
# TODO check the process with pid $PID_FILE_BACKEND is really alive
return;
}
=head2 open_vm
Connects to a Virtual Machine Manager ( or VMM ( or VM )).
......
......@@ -353,16 +353,9 @@ sub ping_backend {
my $self = {};
bless ($self, $class);
return ( $self->_ping_backend_localhost()
or $self->_new_request( command => 'ping_backend' ));
return $self->_new_request( command => 'ping_backend' );
}
sub _ping_backend_localhost {
my $self = shift;
return 1 if -e $PID_FILE_BACKEND;
# TODO check the process with pid $PID_FILE_BACKEND is really alive
return;
}
=head2 domdisplay
......
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