Update problem_statuses after job
authorMarius Gavrilescu <marius@ieval.ro>
Fri, 19 Dec 2014 11:06:46 +0000 (13:06 +0200)
committerMarius Gavrilescu <marius@ieval.ro>
Fri, 19 Dec 2014 11:06:46 +0000 (13:06 +0200)
lib/Gruntmaster/Daemon.pm

index cb41e0d..15f6410 100644 (file)
@@ -147,6 +147,14 @@ sub process{
                $errors ? (errors => $errors) : ()
        });
 
+       my $solved = $meta->{result} ? 0 : 1;
+       my $status = $db->problem_statuses->find($jobr->owner, $jobr->problem);
+       $db->problem_statuses->update_or_create({
+               problem => $jobr->problem,
+               owner   => $jobr->owner,
+               job     => $jobr->id,
+               solved  => $solved});
+
        my $log = $jobr->contest ? 'ct/' . $jobr->contest->id . '/log' : 'log';
        my $page = int (($job + PAGE_SIZE - 1) / PAGE_SIZE);
 
This page took 0.022175 seconds and 4 git commands to generate.