Commit be27ccce authored by Leo Gordon's avatar Leo Gordon
Browse files

bugfix: reset the tried jobs to retry_count=1 and untried ones to...

bugfix: reset the tried jobs to retry_count=1 and untried ones to retry_count=0 when doing a bulk reset
parent b9dc3a8f
...@@ -709,7 +709,13 @@ sub gc_dataflow { ...@@ -709,7 +709,13 @@ sub gc_dataflow {
sub reset_jobs_for_analysis_id { sub reset_jobs_for_analysis_id {
my ($self, $analysis_id, $all) = @_; my ($self, $analysis_id, $all) = @_;
my $sql = "UPDATE job SET status='READY', retry_count=0 WHERE analysis_id=?".($all ? "" : " AND status='FAILED'"); my $sql = qq{
UPDATE jobs
SET retry_count = CASE WHEN (status='COMPILATION' OR status='READY' OR status='CLAIMED') THEN 0 ELSE 1 END
, status='READY'
WHERE analysis_id=?
} . ($all ? "" : " AND status='FAILED'");
my $sth = $self->prepare($sql); my $sth = $self->prepare($sql);
$sth->execute($analysis_id); $sth->execute($analysis_id);
$sth->finish; $sth->finish;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment