Skip to content

Commit

Permalink
purge removed, red herring, added retry to XML retrieval
Browse files Browse the repository at this point in the history
  • Loading branch information
keiranmraine committed Aug 3, 2015
1 parent b9645d3 commit 83b1396
Showing 1 changed file with 20 additions and 15 deletions.
35 changes: 20 additions & 15 deletions bin/gnos_pull.pl
Original file line number Diff line number Diff line change
Expand Up @@ -253,9 +253,6 @@ sub pull_bam {
}
return if($options->{'symlinks'});

# if partial and relevant flag set remove download
remove_tree($f_base) if($options->{'purge'});

my $out_file = "$f_base.out.log";
my $err_file = "$f_base.err.log";
$download .= " > $f_base.out.log";
Expand Down Expand Up @@ -290,15 +287,26 @@ sub create_bas {
return if(-s $bas_file);
# pull the bas file, done here to handle back fill of this data
my $get_bas = sprintf '%s %s/xml_to_bas.pl -d %scghub/metadata/analysisFull/%s -o %s -b %s',
$^X,
$Bin,
$repo,
$gnos_id,
$bas_file,
$sym_bam;
warn "Executing: $get_bas\n";
my ($stdout, $stderr, $exit_c) = capture { system($get_bas); };
die "A problem occured while executing: $get_bas\n\nSTDOUT:\n$stdout\n\nSTDERR:$stderr\n" if($exit_c);
$^X,
$Bin,
$repo,
$gnos_id,
$bas_file,
$sym_bam;
my $success = 0;
for(0..5) {
warn "Executing: $get_bas\n";
my ($stdout, $stderr, $exit_c) = capture { system($get_bas); };
if($exit_c) {
warn "A problem occured while executing: $get_bas\n\nSTDOUT:\n$stdout\n\nSTDERR:$stderr\n...Retry\n";
sleep 30;
}
else {
$success++;
last;
}
}
die "Failed after multiple attempts, aborting bas generation using $get_bas" unless($success);
return 1;
}

Expand Down Expand Up @@ -544,7 +552,6 @@ sub option_builder {
'm|man' => \$opts{'m'},
'i|info' => \$opts{'info'},
's|symlinks' => \$opts{'symlinks'},
'p|purge' => \$opts{'purge'},
'u|url=s' => \$opts{'url'},
't|threads=i' => \$opts{'threads'},
'a|analysis=s' => \$opts{'analysis'},
Expand Down Expand Up @@ -595,8 +602,6 @@ =head1 SYNOPSIS
--symlinks (-s) Rebuild symlinks only.
--purge (-p) Purge partial downloads and start from scratch.
--threads (-t) Number of parallel GNOS retrievals.
--url (-u) The base URL to retrieve jsonl file from
Expand Down

0 comments on commit 83b1396

Please sign in to comment.