Commit 13967539 authored by Jessica Severin's avatar Jessica Severin
Browse files

changed ORDER BY in fetch_by_needed_workers() to first sort by num_required_workers DESC

which causes a more even distribution of workers types as they are created by the Queen.
parent 3de084f6
......@@ -83,9 +83,9 @@ sub fetch_by_needed_workers {
my $limit = shift;
my $constraint = "ast.num_required_workers>0 AND ast.status in ('READY','WORKING')";
if($limit) {
$self->_final_clause("ORDER BY hive_capacity DESC, analysis_id LIMIT $limit");
$self->_final_clause("ORDER BY num_required_workers DESC, hive_capacity DESC, analysis_id LIMIT $limit");
} else {
$self->_final_clause("ORDER BY hive_capacity DESC, analysis_id");
$self->_final_clause("ORDER BY num_required_workers DESC, hive_capacity DESC, analysis_id");
my $results = $self->_generic_fetch($constraint);
$self->_final_clause(""); #reset final clause for other fetches
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