Commit 6f85948d authored by Leo Gordon's avatar Leo Gordon
Browse files

fetch_failed_workers() is dropped as no longer used, get_hive_current_load() cosmetically touched

parent edf72142
...@@ -457,13 +457,6 @@ sub fetch_overdue_workers { ...@@ -457,13 +457,6 @@ sub fetch_overdue_workers {
} }
sub fetch_failed_workers {
my $self = shift;
return $self->fetch_all( "cause_of_death='FATALITY'" );
}
sub fetch_all_dead_workers_with_jobs { sub fetch_all_dead_workers_with_jobs {
my $self = shift; my $self = shift;
...@@ -681,16 +674,16 @@ sub get_num_failed_analyses { ...@@ -681,16 +674,16 @@ sub get_num_failed_analyses {
sub get_hive_current_load { sub get_hive_current_load {
my $self = shift; my $self = shift;
my $sql = "SELECT sum(1/s.hive_capacity) FROM worker w, analysis_stats s ". my $sql = qq{
"WHERE w.analysis_id=s.analysis_id and w.cause_of_death ='' ". SELECT sum(1/hive_capacity)
"AND s.hive_capacity>0"; FROM worker JOIN analysis_stats USING(analysis_id)
WHERE cause_of_death ='' AND hive_capacity>0
};
my $sth = $self->prepare($sql); my $sth = $self->prepare($sql);
$sth->execute(); $sth->execute();
(my $load)=$sth->fetchrow_array(); my ($load)=$sth->fetchrow_array();
$sth->finish; $sth->finish;
$load=0 unless($load); return ($load || 0);
# print("current hive load = $load\n");
return $load;
} }
......
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