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
a97afa4c
Commit
a97afa4c
authored
May 13, 2016
by
Matthieu Muffato
Browse files
Moved the creation of the log_dir to Worker
parent
35ec0b67
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
12 deletions
+19
-12
modules/Bio/EnsEMBL/Hive/Queen.pm
modules/Bio/EnsEMBL/Hive/Queen.pm
+1
-12
modules/Bio/EnsEMBL/Hive/Worker.pm
modules/Bio/EnsEMBL/Hive/Worker.pm
+18
-0
No files found.
modules/Bio/EnsEMBL/Hive/Queen.pm
View file @
a97afa4c
...
...
@@ -159,18 +159,7 @@ sub create_new_worker {
$worker
=
$self
->
fetch_by_dbID
(
$worker_id
)
# refresh the object to get the fields initialized at SQL level (timestamps in this case)
or
die
"
Could not fetch worker with dbID=
$worker_id
";
if
(
$hive_log_dir
or
$worker_log_dir
)
{
my
$dir_revhash
=
dir_revhash
(
$worker_id
);
$worker_log_dir
||=
$hive_log_dir
.
'
/
'
.
(
$dir_revhash
?
"
$dir_revhash
/
"
:
'')
.
'
worker_id_
'
.
$worker_id
;
eval
{
make_path
(
$worker_log_dir
);
1
;
}
or
die
"
Could not create '
$worker_log_dir
' directory : $@
";
$worker
->
log_dir
(
$worker_log_dir
);
$self
->
update_log_dir
(
$worker
);
# autoloaded
}
$worker
->
set_log_directory_name
(
$hive_log_dir
,
$worker_log_dir
);
$worker
->
init
;
...
...
modules/Bio/EnsEMBL/Hive/Worker.pm
View file @
a97afa4c
...
...
@@ -864,4 +864,22 @@ sub check_analysis_for_exclusion {
}
}
sub
set_log_directory_name
{
my
(
$self
,
$hive_log_dir
,
$worker_log_dir
);
return
unless
(
$hive_log_dir
or
$worker_log_dir
);
my
$dir_revhash
=
dir_revhash
(
$self
->
dbID
);
$worker_log_dir
||=
$hive_log_dir
.
'
/
'
.
(
$dir_revhash
?
"
$dir_revhash
/
"
:
'')
.
'
worker_id_
'
.
$self
->
dbID
;
eval
{
make_path
(
$worker_log_dir
);
1
;
}
or
die
"
Could not create '
$worker_log_dir
' directory : $@
";
$self
->
log_dir
(
$worker_log_dir
);
$self
->
adaptor
->
update_log_dir
(
$self
);
# autoloaded
}
1
;
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