From 575828ac3790c473f05e395b14e698ee014c99dc Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fabian=20Gr=C3=BCnbichler?= Date: Mon, 29 Jul 2019 14:45:09 +0200 Subject: [PATCH] mimetypes: load on first access MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit otherwise this generated file needs to be available at (docs) build time, which is not the case in a clean chroot. caching per worker remains identical. Signed-off-by: Fabian Grünbichler --- src/PMG/API2/MimeTypes.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/PMG/API2/MimeTypes.pm b/src/PMG/API2/MimeTypes.pm index 2c1db5d..9d5e952 100644 --- a/src/PMG/API2/MimeTypes.pm +++ b/src/PMG/API2/MimeTypes.pm @@ -66,8 +66,6 @@ my $load_mime_types = sub { } }; -$load_mime_types->(); - __PACKAGE__->register_method ({ name => 'index', path => '', @@ -89,6 +87,8 @@ __PACKAGE__->register_method ({ code => sub { my ($param) = @_; + $mime = $load_mime_types->(); + return $mime; }}); -- 2.39.2