Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ensembl-gh-mirror
ensembl-hive
Commits
0d6c4bf4
Commit
0d6c4bf4
authored
May 09, 2014
by
Leo Gordon
Browse files
cosmetic: rearrange the control flow for better readability
parent
35d32087
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
6 deletions
+5
-6
modules/Bio/EnsEMBL/Hive/Queen.pm
modules/Bio/EnsEMBL/Hive/Queen.pm
+5
-6
No files found.
modules/Bio/EnsEMBL/Hive/Queen.pm
View file @
0d6c4bf4
...
...
@@ -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
}
}
#
jus
t a quick summary report:
#
prin
t 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
";
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment