Commit 0d6c4bf4 authored by Leo Gordon's avatar Leo Gordon
Browse files

cosmetic: rearrange the control flow for better readability

parent 35d32087
......@@ -369,12 +369,8 @@ sub check_for_dead_workers { # scans the whole Valley for lost Workers (but i
my $meadow_type = $worker->meadow_type;
if(my $meadow = $valley->find_available_meadow_responsible_for_worker($worker)) {
$mt_and_pid_to_worker_status{$meadow_type} ||= $meadow->status_of_all_our_workers;
} else {
$worker_status_counts{$meadow_type}{'UNREACHABLE'}++;
next; # Worker is unreachable from this Valley
}
$mt_and_pid_to_worker_status{$meadow_type} ||= $meadow->status_of_all_our_workers; # only run this once per reachable Meadow
my $process_id = $worker->process_id;
if(my $status = $mt_and_pid_to_worker_status{$meadow_type}{$process_id}) { # can be RUN|PEND|xSUSP
......@@ -384,9 +380,12 @@ sub check_for_dead_workers { # scans the whole Valley for lost Workers (but i
$mt_and_pid_to_lost_worker{$meadow_type}{$process_id} = $worker;
}
} else {
$worker_status_counts{$meadow_type}{'UNREACHABLE'}++; # Worker is unreachable from this Valley
}
}
# just a quick summary report:
# print a quick summary report:
foreach my $meadow_type (keys %worker_status_counts) {
warn "GarbageCollector:\t[$meadow_type Meadow:]\t".join(', ', map { "$_:$worker_status_counts{$meadow_type}{$_}" } keys %{$worker_status_counts{$meadow_type}})."\n\n";
}
......
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