Commit 60c148c3 authored by Francesc Guasch's avatar Francesc Guasch
Browse files

[#100] fix the call the the request processing

parent 8303050e
......@@ -67,18 +67,16 @@ sub do_start {
my $old_error = ($@ or '');
my $cnt_error = 0;
start_process_longs() if !$NOFORK;
my $ravada = Ravada->new( config => $FILE_CONFIG );
$ravada->clean_killed_requests();
clean_killed_requests();
start_process_longs() if !$NOFORK;
my $ravada = Ravada->new( config => $FILE_CONFIG );
for (;;) {
my $t0 = time;
$ravada->process_requests();
$ravada->process_long_requests(0,$NOFORK) if $NOFORK;
sleep 1;
sleep 1 if time - $t0 <1;
}
}
......@@ -92,12 +90,18 @@ sub start_process_longs {
warn "Processing long requests in pid $$\n" if $DEBUG;
my $ravada = Ravada->new( config => $FILE_CONFIG );
$ravada->clean_killed_requests();
for (;;) {
my $t0 = time;
$ravada->process_long_requests();
sleep 1 if time - $t0 <1;
}
}
sub clean_killed_requests {
my $ravada = Ravada->new( config => $FILE_CONFIG );
$ravada->clean_killed_requests();
}
sub start {
for (;;) {
my $pid = fork();
......
......@@ -582,8 +582,8 @@ sub process_requests {
my $self = shift;
my $debug = shift;
my $dont_fork = shift;
my $long_commands = shift;
my $short_commands = shift;
my $long_commands = (shift or 0);
my $short_commands = (shift or 0);
$self->_wait_pids_nohang();
......
Supports Markdown
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