diff --git a/modules/Bio/EnsEMBL/Hive/Process.pm b/modules/Bio/EnsEMBL/Hive/Process.pm index 9383f45ba76d180599dc956e75ac6f01dad9d39e..33e11d1db00b167a25907a8b80c6578bbd44467c 100755 --- a/modules/Bio/EnsEMBL/Hive/Process.pm +++ b/modules/Bio/EnsEMBL/Hive/Process.pm @@ -478,5 +478,35 @@ sub output { return @{$self->{'output'}}; } +=head2 check_if_exit_cleanly + + Title : check_if_exit_cleanly + Usage : $self->check_if_exit_cleanly() + Function: Check if we want to exit or kill it cleanly at the + runnable level + Returns : None + Args : None + +=cut + +sub check_if_exit_cleanly { + my $self = shift; + + my $id = $self->input_job->dbID; + my $honeycomb_dir = $self->{'honeycomb_dir'}; + $honeycomb_dir =~ s/\/$//; + my $not_allowed = $honeycomb_dir . "/" . "relegate." . $id; + my $exit_cleanly = $honeycomb_dir . "/" . "relegate.all"; + if (-e $not_allowed) { + $self->update_status('FAILED'); + throw("This job has been relegated to be killed - $id\n"); + } elsif (-e $exit_cleanly) { + $self->update_status('READY'); + throw("This job has been relegated to be exited - $id\n"); + } + return undef; +} + 1; +