]> git.proxmox.com Git - pve-storage.git/commitdiff
status: move unlink from http-server to enpoint
authorLorenz Stechauner <l.stechauner@proxmox.com>
Tue, 31 Aug 2021 10:16:29 +0000 (12:16 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 6 Sep 2021 06:28:26 +0000 (08:28 +0200)
this is the first step in which not the http server removes the
temporary file, but the worker itself.

Signed-off-by: Lorenz Stechauner <l.stechauner@proxmox.com>
PVE/API2/Storage/Status.pm

index b838461db4b6d2076689ab72f861bfa4d9ee7923..cc8ed5ad33b417baa47de2939bb5cff4615e0959 100644 (file)
@@ -486,6 +486,12 @@ __PACKAGE__->register_method ({
            print "command: " . join(' ', @$cmd) . "\n";
 
            eval { run_command($cmd, errmsg => 'import failed'); };
+
+           # unlinks only the temporary file from the http server
+           unlink $tmpfilename;
+           warn "unable to clean up temporary file '$tmpfilename' - $!\n"
+               if $! && $! != ENOENT;
+
            if (my $err = $@) {
                eval { $err_cleanup->() };
                warn "$@" if $@;