From: Marius Gavrilescu Date: Wed, 4 Feb 2015 20:29:37 +0000 (+0200) Subject: Skip private jobs in update_status X-Git-Tag: 5999.000_014~89 X-Git-Url: http://git.ieval.ro/?p=gruntmaster-data.git;a=commitdiff_plain;h=64bc7dfb7f8c15cbfa17f9448f3f26889a6dfc3c Skip private jobs in update_status --- diff --git a/lib/Gruntmaster/Data.pm b/lib/Gruntmaster/Data.pm index 16a6176..741061b 100644 --- a/lib/Gruntmaster/Data.pm +++ b/lib/Gruntmaster/Data.pm @@ -174,10 +174,14 @@ sub job_entry { sub update_status { my ($self) = @_; - my @jobs = $self->jobs->search(undef, {cache => 1})->all; + my @jobs = $self->jobs->search({private => 0}, {cache => 1, prefetch => 'problem'})->all; my %hash; - $hash{$_->get_column('problem'), $_->get_column('owner')} = [$_->id, $_->result ? 0 : 1] for @jobs; + for (@jobs) { + next if !$_->problem->is_in_archive; + $hash{$_->get_column('problem'), $_->get_column('owner')} = [$_->id, $_->result ? 0 : 1] for @jobs; + } + my @problem_statuses = map { [split ($;), @{$hash{$_}} ] } keys %hash; my @contest_statuses = map {