Skip to content

Commit 32cbdff

Browse files
committed
xslate: don't try to remove cache dir
On older deployments, the xslate cache would sometimes not correctly detect new template files, leading to unpredictable errors. Purging of the cache directory on startup was added to deal with this. The normal deployment is now done with a docker container, so there is nothing to clear out at startup. Additionally, the cache directory isn't being configured to a static path, so it will always be using a newly created temp directory. Clearing out the template cache is no longer relevant, so it can be removed.
1 parent 29f566b commit 32cbdff

File tree

1 file changed

+0
-11
lines changed

1 file changed

+0
-11
lines changed

lib/MetaCPAN/Web/View/Xslate.pm

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package MetaCPAN::Web::View::Xslate;
22
use Moose;
33
extends qw(Catalyst::View::Xslate);
4-
use File::Path ();
54
use File::Temp ();
65
use MetaCPAN::Web::Types qw( AbsPath );
76

@@ -48,16 +47,6 @@ sub COMPONENT {
4847
return $class->SUPER::COMPONENT( $app, $args );
4948
}
5049

51-
around preload_templates => sub {
52-
my ( $orig, $self ) = ( shift, shift );
53-
54-
if ( my $cache_dir = $self->xslate->{cache_dir} ) {
55-
File::Path::rmtree($cache_dir);
56-
}
57-
58-
$self->$orig(@_);
59-
};
60-
6150
has '+expose_methods' => (
6251
default =>
6352
sub

0 commit comments

Comments
 (0)