From: Fabian Grünbichler Date: Mon, 29 Jul 2019 12:45:09 +0000 (+0200) Subject: mimetypes: load on first access X-Git-Url: https://git.proxmox.com/?p=pmg-api.git;a=commitdiff_plain;h=575828ac3790c473f05e395b14e698ee014c99dc mimetypes: load on first access 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 --- 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; }});