From 64bc7dfb7f8c15cbfa17f9448f3f26889a6dfc3c Mon Sep 17 00:00:00 2001 From: Marius Gavrilescu Date: Wed, 4 Feb 2015 22:29:37 +0200 Subject: [PATCH] Skip private jobs in update_status --- lib/Gruntmaster/Data.pm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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 { -- 2.39.2