Skip to content

Commit

Permalink
Merge pull request #3216 from metacpan/haarg/cache-in-tmp
Browse files Browse the repository at this point in the history
use temp directory for xslate cache
  • Loading branch information
oalders authored Oct 29, 2024
2 parents e6a2a93 + 1129935 commit 1f9ff3e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 0 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ RUN \
cpm install --show-build-log-on-failure --resolver=snapshot
EOT

RUN mkdir var && chown metacpan:users var

ENV PERL5LIB="/app/local/lib/perl5"
ENV PATH="/app/local/bin:${PATH}"

Expand Down
12 changes: 10 additions & 2 deletions lib/MetaCPAN/Web/View/Xslate.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,23 @@ package MetaCPAN::Web::View::Xslate;
use Moose;
extends qw(Catalyst::View::Xslate);
use File::Path ();
use File::Temp ();
use MetaCPAN::Web::Types qw( AbsPath );

has '+syntax' => ( default => 'Metakolon' );
has '+encode_body' => ( default => 0 );
has '+preload' => ( default => 0 );
has '+cache' => ( default => 0 );
has '+cache_dir' => (
isa => AbsPath,
coerce => 1,
isa => AbsPath,
coerce => 1,
default => sub {
File::Temp::tempdir(
TEMPLATE => 'metacpan-web-templates-XXXXXX',
CLEANUP => 1,
TMPDIR => 1,
);
},
);
has '+module' => (
default =>
Expand Down
1 change: 0 additions & 1 deletion metacpan_web.conf
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ log4perl_file = log4perl.conf
mark_unauthorized_releases = 0

<View::Xslate>
cache_dir = var/tmp/templates
cache = 1
</View::Xslate>

Expand Down

0 comments on commit 1f9ff3e

Please sign in to comment.