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

removed a residual (pre autocalc of batchsize from runtime statistics)

design element in Worker::batch_size
- old design: setting the batch_size for a worker changed the batch_size for
  all workers by updating the analysis_stats.batch_size of the corresponding
  analysis. Although this code was never triggered in the current system, it
  could have caused potential problems for future developers.
Now setting the batch_size explicitly for a worker only effects the
batch_size for that Worker instance. If it has not been set, the Worker pulls
the batch_size from the analysis_stats record and optionally autocalcs from
avg_msec_per_job if the batch_size<=0.
parent ccf5d0a5
......@@ -339,17 +339,23 @@ sub cleanup_worker_process_temp_directory {
=cut
sub set_worker_batch_size {
my $self = shift;
my $batch_size = shift;
if(defined($batch_size)) {
$self->{'_batch_size'} = $batch_size;
}
}
sub batch_size {
my $self = shift;
my $stats = $self->analysis->stats;
my $batch_size = $stats->batch_size;
if(@_) {
$batch_size = shift;
$stats->batch_size($batch_size);
$stats->update;
}
if(defined($self->{'_batch_size'})) {
$batch_size = $self->{'_batch_size'};
}
if(($batch_size <= 0) and ($stats->avg_msec_per_job)) {
$batch_size = int(120000 / $stats->avg_msec_per_job); # num jobs in 120 secs
}
......
......@@ -171,11 +171,10 @@ else {
}
if($self->{'batch_size'}) {
$worker->batch_size($self->{'batch_size'});
$worker->set_worker_batch_size($self->{'batch_size'});
}
if($self->{'job_limit'}) {
$worker->job_limit($self->{'job_limit'});
$worker->batch_size($self->{'job_limit'});
$worker->life_span(0);
}
if($self->{'lifespan'}) {
......
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