diff --git a/modules/Bio/EnsEMBL/Hive/Worker.pm b/modules/Bio/EnsEMBL/Hive/Worker.pm index 23fa7047965aa58ab59767295741548fdde3ed97..998bfe4ac454b236c9e4c45b1acb1140c4495c26 100755 --- a/modules/Bio/EnsEMBL/Hive/Worker.pm +++ b/modules/Bio/EnsEMBL/Hive/Worker.pm @@ -174,12 +174,7 @@ sub life_span { sub job_limit { my $self=shift; - if(@_) { - $self->{'_job_limit'}=shift; - if($self->{'_job_limit'} < $self->batch_size) { - $self->batch_size($self->{'_job_limit'}); - } - } + $self->{'_job_limit'}=shift if(@_); return $self->{'_job_limit'}; } @@ -298,7 +293,11 @@ sub batch_size { $stats->batch_size($batch_size); $stats->update; } - return $self->analysis->stats->batch_size; + my $batch_size = $self->analysis->stats->batch_size; + if($self->job_limit < $batch_size) { + $batch_size = $self->job_limit; + } + return $batch_size; }