Unverified Commit 1cacd475 authored by Francesc Guasch's avatar Francesc Guasch Committed by GitHub
Browse files

feature(backend): remove unnecessary down req (#1075)

closes issue #1074
parent 27ab8ff2
......@@ -2919,6 +2919,7 @@ sub _cmd_refresh_vms($self, $request=undef) {
my ($active_domain, $active_vm) = $self->_refresh_active_domains($request);
$self->_refresh_down_domains($active_domain, $active_vm);
$self->_remove_unnecessary_downs();
$self->_clean_requests('refresh_vms', $request);
$self->_refresh_volatile_domains();
......@@ -3132,6 +3133,15 @@ sub _refresh_down_domains($self, $active_domain, $active_vm) {
}
}
sub _remove_unnecessary_downs($self) {
for my $domain ($self->list_domains( active => 0 )) {
my @requests = $domain->list_requests;
for my $req (@requests) {
$req->status('done') if $req->command =~ /^shutdown/;
}
}
}
sub _refresh_volatile_domains($self) {
my $sth = $CONNECTOR->dbh->prepare(
"SELECT id, name, id_vm FROM domains WHERE is_volatile=1"
......
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