public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH storage] status: add unlink to worker in file upload
@ 2021-07-21 12:52 Lorenz Stechauner
  2021-07-21 14:51 ` Thomas Lamprecht
  0 siblings, 1 reply; 2+ messages in thread
From: Lorenz Stechauner @ 2021-07-21 12:52 UTC (permalink / raw)
  To: pve-devel

this is the first step in which not the http server removes the
temporary file, but the worker itself. for now, this `unlink`
statement won't unlink anything existing. but after changes to
the http server have been made, the endpoint will be able to
clean up for itself afterwards.

Signed-off-by: Lorenz Stechauner <l.stechauner@proxmox.com>
---
a version bump would be helpful, so the older versions can be
marked as 'breaks' in the pve-http-server repo after the above
mentioned changes.

 PVE/API2/Storage/Status.pm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/PVE/API2/Storage/Status.pm b/PVE/API2/Storage/Status.pm
index 72fd851..9275d1f 100644
--- a/PVE/API2/Storage/Status.pm
+++ b/PVE/API2/Storage/Status.pm
@@ -478,6 +478,7 @@ __PACKAGE__->register_method ({
 	    print "command: " . join(' ', @$cmd) . "\n";
 
 	    eval { PVE::Tools::run_command($cmd, errmsg => 'import failed'); };
+	    unlink $tmpfilename;
 	    if (my $err = $@) {
 		unlink $dest;
 		die $err;
-- 
2.30.2





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-07-21 14:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-21 12:52 [pve-devel] [PATCH storage] status: add unlink to worker in file upload Lorenz Stechauner
2021-07-21 14:51 ` Thomas Lamprecht

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal