Commit a1d141a8 authored by Kathryn Beal's avatar Kathryn Beal
Browse files

Reverted back to the previous version (1.44) because the change to the query made it much slower.

parent 2c97e3cd
......@@ -483,16 +483,23 @@ sub claim_jobs_for_worker {
my $claim = $ug->to_string( $uuid );
#print("claiming jobs for hive_id=", $worker->hive_id, " with uuid $claim\n");
my $sql = "UPDATE analysis_job SET job_claim='$claim'".
my $sql_base = "UPDATE analysis_job SET job_claim='$claim'".
" , hive_id='". $worker->hive_id ."'".
" , status='CLAIMED'".
" WHERE job_claim='' and status='READY'".
" AND analysis_id=" .$worker->analysis->dbID.
" ORDER BY retry_count ".
" LIMIT ". $worker->batch_size;
" AND analysis_id='" .$worker->analysis->dbID. "'";
my $claim_count = $self->dbc->do($sql); # $claim_count currently unused
my $sql_virgin = $sql_base .
" AND retry_count=0".
" LIMIT " . $worker->batch_size;
my $sql_any = $sql_base .
" LIMIT " . $worker->batch_size;
my $claim_count = $self->dbc->do($sql_virgin);
if($claim_count == 0) {
$claim_count = $self->dbc->do($sql_any);
}
return $claim;
}
......
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