From b335c4bbcd278396e05c11d9bf60e0807a78726d Mon Sep 17 00:00:00 2001 From: Marius Gavrilescu Date: Fri, 19 Dec 2014 13:06:46 +0200 Subject: [PATCH] Update problem_statuses after job --- lib/Gruntmaster/Daemon.pm | 8 ++++++++ 1 file changed, 8 insertions(+) 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); -- 2.39.2