projects
/
gruntmaster-data.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
c314c86
)
Skip private jobs in update_status faster
author
Marius Gavrilescu
<marius@ieval.ro>
Wed, 4 Feb 2015 20:40:26 +0000
(22:40 +0200)
committer
Marius Gavrilescu
<marius@ieval.ro>
Wed, 4 Feb 2015 20:40:26 +0000
(22:40 +0200)
lib/Gruntmaster/Data.pm
patch
|
blob
|
blame
|
history
diff --git
a/lib/Gruntmaster/Data.pm
b/lib/Gruntmaster/Data.pm
index 447a9f4119adaf77b2e07a156ec43af084741f8f..ed40c3744ca5582ee3fb6001a31512548bf7c3ff 100644
(file)
--- a/
lib/Gruntmaster/Data.pm
+++ b/
lib/Gruntmaster/Data.pm
@@
-176,10
+176,13
@@
sub update_status {
my ($self) = @_;
my @jobs = $self->jobs->search({'me.private' => 0}, {cache => 1, prefetch => 'problem'})->all;
my ($self) = @_;
my @jobs = $self->jobs->search({'me.private' => 0}, {cache => 1, prefetch => 'problem'})->all;
+ my %private;
my %hash;
for (@jobs) {
my %hash;
for (@jobs) {
- next if !$_->problem->is_in_archive;
- $hash{$_->get_column('problem'), $_->get_column('owner')} = [$_->id, $_->result ? 0 : 1] for @jobs;
+ my $pb = $_->get_column('problem');
+ $private{$pb} //= $_->problem->is_private;
+ next if !$private{$pb};
+ $hash{$pb, $_->get_column('owner')} = [$_->id, $_->result ? 0 : 1] for @jobs;
}
my @problem_statuses = map { [split ($;), @{$hash{$_}} ] } keys %hash;
}
my @problem_statuses = map { [split ($;), @{$hash{$_}} ] } keys %hash;
This page took
0.01156 seconds
and
4
git commands to generate.