Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use temp directory for xslate cache #3216

Merged
merged 1 commit into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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