status: move unlink from http-server to enpoint

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>
This commit is contained in:
Lorenz Stechauner
2021-08-31 12:16:29 +02:00
committed by Thomas Lamprecht
parent e2f8e86c83
commit f6aeefff54

View 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 $@;