Skip private jobs in update_status
authorMarius Gavrilescu <marius@ieval.ro>
Wed, 4 Feb 2015 20:29:37 +0000 (22:29 +0200)
committerMarius Gavrilescu <marius@ieval.ro>
Wed, 4 Feb 2015 20:29:37 +0000 (22:29 +0200)
lib/Gruntmaster/Data.pm

index 16a6176fcf65e6b0cf8c5c5d41590d5e6bdb6c7e..741061bfc99409a1c6b47d67aac59ec6be9140ed 100644 (file)
@@ -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 {
This page took 0.010705 seconds and 4 git commands to generate.