diff --git a/lib/Ravada/Request.pm b/lib/Ravada/Request.pm index 60fe69dcf..8f92fe5f8 100644 --- a/lib/Ravada/Request.pm +++ b/lib/Ravada/Request.pm @@ -713,6 +713,7 @@ sub _duplicated_request($self=undef, $command=undef, $args=undef) { confess "Error: missing command " if !$command; # delete $args_d->{uid} unless $command eq 'clone'; delete $args_d->{uid} if $command =~ /(cleanup|refresh_vms|set_base_vm)/; + delete $args_d->{uid} if exists $args_d->{uid} && !defined $args_d->{uid}; delete $args_d->{at}; delete $args_d->{status}; delete $args_d->{timeout}; @@ -720,7 +721,7 @@ sub _duplicated_request($self=undef, $command=undef, $args=undef) { my $sth = $$CONNECTOR->dbh->prepare( "SELECT id,args FROM requests WHERE (status <> 'done')" ." AND command=?" - ." AND ( error = '' OR error is NULL)" + ." AND ( error = '' OR error is NULL OR error like '% waiting for process%')" ); $sth->execute($command); while (my ($id,$args_found) = $sth->fetchrow) { diff --git a/script/rvd_back b/script/rvd_back index 3b7ca9c2f..a17e82849 100755 --- a/script/rvd_back +++ b/script/rvd_back @@ -280,9 +280,12 @@ sub do_start { if ( time - $t_refresh > 60 ) { Ravada::Request->cleanup(); - Ravada::Request->refresh_vms() if rand(5)<3; - Ravada::Request->enforce_limits() if rand(5)<2; - Ravada::Request->manage_pools() if rand(5)<2; + next if rand(5)>2; + + Ravada::Request->refresh_vms(); + Ravada::Request->enforce_limits(); + Ravada::Request->manage_pools(); + $t_refresh = time; } sleep 1 if time - $t0 <1;