Permalink
Browse files

Implement CleanReportCache task

  • Loading branch information...
1 parent 037e6a8 commit 90a0ba6364fe7e346e2ff9ba4674df14a97ffbe9 Ray Miller committed Aug 1, 2012
Showing with 34 additions and 1 deletion.
  1. +1 −1 .gitignore
  2. +3 −0 Changes
  3. +30 −0 lib/LIMS2/Task/General/CleanReportCache.pm
View
2 .gitignore
@@ -1,3 +1,3 @@
.build
-.LIMS2-Tasks-*
+LIMS2-Tasks-*
*~
View
3 Changes
@@ -0,0 +1,3 @@
+{{$NEXT}}
+
+ Initial release.
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__

0 comments on commit 90a0ba6

Please sign in to comment.