Commit 41953ab2 authored by Leo Gordon's avatar Leo Gordon
Browse files

more flexible approach: allows to add triggers later by simply by sourcing the triggers file

parent c95e0fa9
......@@ -44,8 +44,8 @@ sub hive_use_triggers { # getter only, not setter
my $self = shift @_;
unless( defined($self->{'_hive_use_triggers'}) ) {
my $arrRef = $self->get_MetaContainer->list_value_by_key( 'hive_use_triggers' );
$self->{'_hive_use_triggers'} = @$arrRef ? $arrRef->[0] : 0;
my ($hive_use_triggers) = @{ $self->get_MetaContainer->list_value_by_key( 'hive_use_triggers' ) };
$self->{'_hive_use_triggers'} = $hive_use_triggers || 0;
}
return $self->{'_hive_use_triggers'};
}
......
......@@ -314,8 +314,6 @@ sub run {
warn "Loading pipeline-wide parameters ...\n";
my $pipeline_wide_parameters = $self->pipeline_wide_parameters;
$pipeline_wide_parameters->{'hive_use_triggers'} = $self->{'_extra_options'}{'hive_use_triggers'} || 0; # pass it into the database
while( my($meta_key, $meta_value) = each %$pipeline_wide_parameters ) {
if($analysis_topup) {
$meta_container->delete_key($meta_key);
......
......@@ -26,3 +26,6 @@ FOR EACH ROW
failed_job_count = failed_job_count + (CASE NEW.status WHEN 'FAILED' THEN 1 ELSE 0 END)
WHERE analysis_id = NEW.analysis_id;
# inform the runtime part of the system that triggers are in place:
INSERT INTO meta (meta_key, meta_value) VALUES ('hive_use_triggers', '1');
......@@ -32,3 +32,5 @@ BEGIN
WHERE analysis_id = NEW.analysis_id;
END;
# inform the runtime part of the system that triggers are in place:
INSERT INTO meta (meta_key, meta_value) VALUES ('hive_use_triggers', '1');
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