Purge standings in finish_job
[gruntmaster-data.git] / lib / Gruntmaster / Data.pm
index d54f17bed7914dea9d42e0a7992bf6da1a4388c6..5e5c2383c21ecb08983c9f8cae0804a2bd7a1927 100644 (file)
@@ -36,6 +36,7 @@ my %statements = (
 
        job_entry_sth => 'SELECT * FROM job_entry WHERE id = ?',
 
+       rerun_problem_sth => 'UPDATE jobs SET daemon=NULL,result=-2,result_text=NULL,results=NULL,errors=NULL WHERE problem = ?',
        rerun_job_sth => 'UPDATE jobs SET daemon=NULL,result=-2,result_text=NULL,results=NULL,errors=NULL WHERE id = ?',
        take_job_sth => 'UPDATE jobs SET daemon=? WHERE id = (SELECT id FROM jobs WHERE daemon IS NULL LIMIT 1 FOR UPDATE) RETURNING id',
 );
@@ -242,6 +243,12 @@ sub update_status {
        $db->commit
 }
 
+sub rerun_problem {
+       my ($problem) = @_;
+       _query rerun_problem_sth => $problem;
+       purge '/log/';
+}
+
 sub rerun_job {
        my ($id) = @_;
        _query rerun_job_sth => $id;
@@ -263,6 +270,7 @@ sub finish_job {
        db->update(jobs => \%args, {id => $job->{id}});
        purge '/log/';
        purge '/log/' . $job->{id};
+       purge '/st/' . $job->{contest} if $job->{contest};
        return if $private;
        my $status = {
                problem => $job->{problem},
This page took 0.009566 seconds and 4 git commands to generate.