Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: htgt/LIMS2-Tasks
base: 784753db6a
...
head fork: htgt/LIMS2-Tasks
compare: 5ba29c4680
Checking mergeability… Don't worry, you can still create the pull request.
  • 4 commits
  • 7 files changed
  • 0 commit comments
  • 1 contributor
Commits on May 30, 2012
Ray Miller Update for new input field names 57db08a
Commits on Aug 01, 2012
Ray Miller Address Perl::Criitc issues 037e6a8
Ray Miller Implement CleanReportCache task 90a0ba6
Ray Miller v0.001
   Initial release.
5ba29c4
View
2  .gitignore
@@ -1,3 +1,3 @@
.build
-.LIMS2-Tasks-*
+LIMS2-Tasks-*
*~
View
5 Changes
@@ -0,0 +1,5 @@
+{{$NEXT}}
+
+0.001 2012-08-01 11:43:12 Europe/London
+
+ Initial release.
View
5 lib/LIMS2/Task.pm
@@ -62,7 +62,7 @@ has schema => (
sub _build_schema {
my $self = shift;
- LIMS2::Model::DBConnect->connect( 'LIMS2_DB', 'tasks' );
+ return LIMS2::Model::DBConnect->connect( 'LIMS2_DB', 'tasks' );
}
has model => (
@@ -75,7 +75,7 @@ has model => (
sub _build_model {
my $self = shift;
require LIMS2::Model;
- LIMS2::Model->new( schema => $self->schema );
+ return LIMS2::Model->new( schema => $self->schema );
}
has ensembl_util => (
@@ -101,6 +101,7 @@ sub BUILD {
: $WARN;
Log::Log4perl->easy_init( { level => $log_level, layout => $self->log_layout } );
+ return;
}
override command_names => sub {
View
30 lib/LIMS2/Task/General/CleanReportCache.pm
@@ -0,0 +1,30 @@
+package LIMS2::Task::General::CleanReportCache;
+
+use strict;
+use warnings FATAL => 'all';
+
+use Moose;
+use LIMS2::Report;
+use namespace::autoclean;
+
+extends 'LIMS2::Task';
+
+override abstract => sub {
+ 'Delete stale entries from the report cache';
+};
+
+sub execute {
+ my ( $self, $opts, $args ) = @_;
+
+ my $verbose = $self->trace || $self->debug || $self->verbose;
+
+ LIMS2::Report::clean_cache( $self->model, $verbose );
+
+ return;
+}
+
+__PACKAGE__->meta->make_immutable;
+
+1;
+
+__END__
View
10 lib/LIMS2/Task/YAMLDataLoader.pm
@@ -52,7 +52,7 @@ sub execute {
$self->log->info( "Running " . $self->abstract );
my ( $total_seen, $total_skipped, $total_err ) = (0,0,0);
-
+
for my $input_file ( @{$args} ) {
my ( $file_seen, $file_skipped, $file_err ) = $self->load_data_from_file( $input_file );
$total_seen += $file_seen;
@@ -61,11 +61,13 @@ sub execute {
}
$self->log->info( "Processed $total_seen records (skipped $total_skipped, failed $total_err)" );
+
+ return;
}
sub load_data_from_file {
my ( $self, $input_file ) = @_;
-
+
$self->log->info( "Loading data from $input_file" );
my ($file_seen, $file_skipped, $file_err) = (0,0,0);
my $it = iyaml( $input_file );
@@ -73,11 +75,11 @@ sub load_data_from_file {
$file_seen++;
if ( ! $self->wanted( $datum ) ) {
$file_skipped++;
- next;
+ next;
}
try {
$self->model->txn_do(
- sub {
+ sub {
$self->create( $datum );
unless ( $self->commit ) {
$self->model->txn_rollback;
View
8 lib/LIMS2/Task/YAMLDataLoader/LoadDesigns.pm
@@ -23,20 +23,20 @@ override create => sub {
override record_key => sub {
my ( $self, $datum ) = @_;
- return $datum->{design_id} || '<undef>';
+ return $datum->{id} || '<undef>';
};
override wanted => sub {
my ( $self, $datum ) = @_;
unless ( defined $datum->{phase} ) {
- $self->log->warn( "Skipping design $datum->{design_id} - no phase" );
+ $self->log->warn( "Skipping design $datum->{id} - no phase" );
return 0;
}
for my $primer ( @{ $datum->{genotyping_primers} || [] } ) {
- unless ( defined $primer->{genotyping_primer_seq} ) {
- $self->log->warn( "Skipping design $datum->{design_id} - no seq for primer $primer->{genotyping_primer_type}" );
+ unless ( defined $primer->{seq} ) {
+ $self->log->warn( "Skipping design $datum->{id} - no seq for primer $primer->{type}" );
return 0;
}
}
View
4 lib/LIMS2/Tasks.pm
@@ -8,7 +8,9 @@ use namespace::autoclean;
extends 'MooseX::App::Cmd';
-use constant plugin_search_path => [ 'LIMS2::Task::General', 'LIMS2::Task::YAMLDataLoader' ];
+sub plugin_search_path {
+ return [ 'LIMS2::Task::General', 'LIMS2::Task::YAMLDataLoader' ];
+}
__PACKAGE__->meta->make_immutable;

No commit comments for this range

Something went wrong with that request. Please try again.