Commit 5053766d authored by Francesc Guasch's avatar Francesc Guasch
Browse files

refactor(backend): improved check of duplicated tasks

parent 8862e5fd
......@@ -688,25 +688,6 @@ sub _update_isos {
}
sub _update_table_isos_url($self, $data) {
my $sth = $CONNECTOR->dbh->prepare("SELECT * FROM iso_images WHERE name=?");
for my $release (sort keys %$data) {
my $entry = $data->{$release};
$sth->execute($entry->{name});
my $row = $sth->fetchrow_hashref();
for my $field (keys %$entry) {
next if defined $row->{$field} && $row->{$field} eq $entry->{$field};
my $sth_update = $CONNECTOR->dbh->prepare(
"UPDATE iso_images SET $field=?"
." WHERE id=?"
);
$sth_update->execute($entry->{$field}, $row->{id});
warn("INFO: updating $release $field '$row->{$field}' -> '$entry->{$field}'\n")
if !$FIRST_TIME_RUN && $0 !~ /\.t$/;
}
}
}
sub _update_table_isos_url($self, $data) {
my $sth = $CONNECTOR->dbh->prepare("SELECT * FROM iso_images WHERE name=?");
for my $release (sort keys %$data) {
......@@ -3177,14 +3158,17 @@ sub process_requests {
next if $request_type ne 'all' && $req->type ne $request_type;
next if $duplicated{$id_request}++;
next if $duplicated{"id_req.$id_request"}++;
next if $req->command !~ /shutdown/i
&& $self->_domain_working($id_domain, $id_request);
my $domain = '';
$domain = $id_domain if $id_domain;
$domain .= ($req->defined_arg('name') or '');
next if $duplicated{$domain}++;
next if $domain && $duplicated{$domain};
my $id_base = $req->defined_arg('id_base');
next if $id_base && $duplicated{$id_base};
$duplicated{"domain.$domain"}++;
push @reqs,($req);
}
$sth->finish;
......
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