Added rerun_problem and improved gm rerun
[gruntmaster-data.git] / lib / Gruntmaster / Data.pm
index d5d7152462e1218a274c5dd1421ee3a9c56513dc..da2b3c59eb50851a3935f1fc95118b654cbb09d6 100644 (file)
@@ -3,7 +3,7 @@ use 5.014;
 use warnings;
 
 use parent qw/Exporter/;
-our $VERSION = '5999.000_013';
+our $VERSION = '5999.000_015';
 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 take_job finish_job open_problem/;
 our @EXPORT_OK = @EXPORT;
 
@@ -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;
This page took 0.009814 seconds and 4 git commands to generate.