Commit 04217e70 authored by Jessica Severin's avatar Jessica Severin
Browse files

changed order by in fetch_by_needed_workers so that analyses with lower

system load (higher hive_capacity) are picked first
parent 54927cb4
......@@ -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 analysis_id LIMIT $limit");
$self->_final_clause("ORDER BY hive_capacity DESC, analysis_id LIMIT $limit");
} else {
$self->_final_clause("ORDER BY analysis_id");
$self->_final_clause("ORDER BY 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