Ignore pending and running jobs when building standings
[gruntmaster-data.git] / lib / Gruntmaster / Data.pm
index dd6c73faa8d880a25527c3dac51239d338cea6fb..a9c128d0cbb330c914eefdd6a85024495db214e7 100644 (file)
@@ -3,7 +3,7 @@ use 5.014;
 use warnings;
 
 use parent qw/Exporter/;
-our $VERSION = '5999.000_015';
+our $VERSION = '5999.000_016';
 our @EXPORT = qw/dbinit purge db user_list user_entry problem_list problem_entry contest_list contest_entry contest_has_problem job_list job_entry create_job standings update_status rerun_job rerun_problem take_job finish_job open_problem/;
 our @EXPORT_OK = @EXPORT;
 
@@ -192,7 +192,10 @@ sub standings {
                $opens{$problem, $owner} = $time;
        }
 
-       my $jobs = $db->select('job_entry', '*', {contest => $ct->{id}}, 'id');
+       # result IS NULL if job was never run
+       # result = -2 if job is being rerun
+       my %where = (contest => $ct->{id}, result => {'>=', 0});
+       my $jobs = $db->select('job_entry', '*', \%where, 'id');
 
        while (my $job = $jobs->hash) {
                my $open = $opens{$job->{problem}, $job->{owner}} // $ct->{start};
@@ -475,7 +478,7 @@ Marius Gavrilescu E<lt>marius@ieval.roE<gt>
 
 =head1 COPYRIGHT AND LICENSE
 
-Copyright (C) 2014-2015 by Marius Gavrilescu
+Copyright (C) 2014-2016 by Marius Gavrilescu
 
 This library is free software; you can redistribute it and/or modify
 it under the same terms as Perl itself, either Perl version 5.20.1 or,
This page took 0.00961 seconds and 4 git commands to generate.