Commit ef154944 authored by Leo Gordon's avatar Leo Gordon
Browse files

no need to update only the status here, as we are going to update the whole...

no need to update only the status here, as we are going to update the whole AnalysisStats object very soon.
parent 545c992c
......@@ -216,15 +216,6 @@ sub update {
}
}
sub update_status {
my ($self, $status ) = @_;
$self->status($status);
if($self->adaptor) {
$self->adaptor->update_status($self->analysis_id, $status);
}
}
sub get_or_estimate_batch_size {
my $self = shift;
......@@ -333,10 +324,10 @@ sub check_blocking_control_rules {
if($all_conditions_satisfied) {
if($self->status eq 'BLOCKED') { # unblock, since all conditions are met
$self->update_status('LOADING'); # trigger sync
$self->status('LOADING'); # anything that is not 'BLOCKED' will do, it will be redefined in the following subroutine
}
} else { # (re)block
$self->update_status('BLOCKED');
$self->status('BLOCKED');
}
}
......
......@@ -295,7 +295,7 @@ sub specialize_new_worker {
$worker->special_batch( $special_batch );
} else { # count it as autonomous worker sharing the load of that analysis:
$stats->update_status('WORKING');
$analysis_stats_adaptor->update_status($analysis_id, 'WORKING');
$analysis_stats_adaptor->decrease_required_workers($worker->analysis_id);
}
......@@ -617,9 +617,7 @@ sub synchronize_AnalysisStats {
$analysisStats->check_blocking_control_rules();
if($analysisStats->status ne 'BLOCKED') {
$analysisStats->determine_status();
}
$analysisStats->determine_status();
# $analysisStats->sync_lock(0); ## do we perhaps need it here?
$analysisStats->update; #update and release sync_lock
......
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