5
0
mirror of git://git.proxmox.com/git/pve-storage.git synced 2024-12-23 17:34:34 +03:00

status: remove sleep(1) in file upload

this racey sleep(1) is only there for legacy reasons: because
we don't use apache anymore and only emulate its behabiour
regarding removing temp files, this is under our own control
now and so we can improve this whole situation.

this change requires a pve-http-server version, in which the
tmpfile gets not automatically removed anymore.

Signed-off-by: Lorenz Stechauner <l.stechauner@proxmox.com>
This commit is contained in:
Lorenz Stechauner 2021-08-31 12:16:30 +02:00 committed by Thomas Lamprecht
parent a64aedd3eb
commit e4d56f096e

View File

@ -498,14 +498,7 @@ __PACKAGE__->register_method ({
print "finished file import successfully\n"; print "finished file import successfully\n";
}; };
my $upid = $rpcenv->fork_worker('imgcopy', undef, $user, $worker); return $rpcenv->fork_worker('imgcopy', undef, $user, $worker);
# apache removes the temporary file on return, so we need
# to wait here to make sure the worker process starts and
# opens the file before it gets removed.
sleep(1);
return $upid;
}}); }});
__PACKAGE__->register_method({ __PACKAGE__->register_method({