Commit 5215a997 authored by Leo Gordon's avatar Leo Gordon
Browse files

extend a method in JobAdaptor to return a limited number of jobs (for use in generate_graph)

parent f44ec5cb
......@@ -209,11 +209,10 @@ sub fetch_all_by_analysis_id_status {
}
sub fetch_one_example_by_analysis_id {
my ($self, $analysis_id) = @_;
sub fetch_some_by_analysis_id_limit {
my ($self, $analysis_id, $limit) = @_;
my ($job) = @{ $self->_generic_fetch( "j.analysis_id = '$analysis_id'", undef, 'LIMIT 1' ) };
return $job; # if the list was empty, $job will be false
return $self->_generic_fetch( "j.analysis_id = '$analysis_id'", undef, "LIMIT $limit" );
}
......
......@@ -22,7 +22,7 @@ sub show_seedable_analyses {
my $logic_name = $analysis->logic_name;
unless($incoming->{$logic_name}) {
my $analysis_id = $analysis->dbID;
my $example_job = $job_adaptor->fetch_one_example_by_analysis_id( $analysis_id );
my ($example_job) = @{ $job_adaptor->fetch_some_by_analysis_id_limit( $analysis_id, 1 ) };
print "\t$logic_name ($analysis_id)\t\t".($example_job ? "Example input_id: '".$example_job->input_id."'" : "[not populated yet]")."\n";
}
}
......
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