Commit 76b7a3df authored by Leo Gordon's avatar Leo Gordon
Browse files

bugfix: ENSCOMPARASW-132. When all dependent jobs (>1) fail to be created due...

bugfix: ENSCOMPARASW-132. When all dependent jobs (>1) fail to be created due to unique constraint, they now correctly update status to READY
parent 181856f3
......@@ -405,8 +405,8 @@ sub decrease_semaphore_count_for_jobid { # used in semaphore annihilation or
#
my $sql = "UPDATE job "
.( ($self->dbc->driver eq 'pgsql')
? "SET status = CAST(CASE WHEN semaphore_count>1 THEN 'SEMAPHORED' ELSE 'READY' END AS jw_status), "
: "SET status = CASE WHEN semaphore_count>1 THEN 'SEMAPHORED' ELSE 'READY' END, "
? "SET status = CAST(CASE WHEN semaphore_count>$dec THEN 'SEMAPHORED' ELSE 'READY' END AS jw_status), "
: "SET status = CASE WHEN semaphore_count>$dec THEN 'SEMAPHORED' ELSE 'READY' END, "
).qq{
semaphore_count=semaphore_count-?
WHERE job_id=? AND status='SEMAPHORED'
......
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