From: Marius Gavrilescu Date: Fri, 19 Dec 2014 11:06:46 +0000 (+0200) Subject: Update problem_statuses after job X-Git-Tag: 5999.000_005~110 X-Git-Url: http://git.ieval.ro/?a=commitdiff_plain;h=b335c4bbcd278396e05c11d9bf60e0807a78726d;p=gruntmaster-daemon.git Update problem_statuses after job --- diff --git a/lib/Gruntmaster/Daemon.pm b/lib/Gruntmaster/Daemon.pm index cb41e0d..15f6410 100644 --- a/lib/Gruntmaster/Daemon.pm +++ b/lib/Gruntmaster/Daemon.pm @@ -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);