]> git.proxmox.com Git - pmg-api.git/commitdiff
mimetypes: load on first access
authorFabian Grünbichler <f.gruenbichler@proxmox.com>
Mon, 29 Jul 2019 12:45:09 +0000 (14:45 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Tue, 30 Jul 2019 07:59:45 +0000 (09:59 +0200)
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 <f.gruenbichler@proxmox.com>
src/PMG/API2/MimeTypes.pm

index 2c1db5da664bf8e42127c5426f6788feb15da1b0..9d5e952e05302ff0ed69f7dce3253071fe546eff 100644 (file)
@@ -66,8 +66,6 @@ my $load_mime_types = sub {
     }
 };
 
     }
 };
 
-$load_mime_types->();
-
 __PACKAGE__->register_method ({
     name => 'index',
     path => '',
 __PACKAGE__->register_method ({
     name => 'index',
     path => '',
@@ -89,6 +87,8 @@ __PACKAGE__->register_method ({
     code => sub {
        my ($param) = @_;
 
     code => sub {
        my ($param) = @_;
 
+       $mime = $load_mime_types->();
+
        return $mime;
     }});
 
        return $mime;
     }});