[pve-devel] [PATCH common] add upid_wait method
Thomas Lamprecht
t.lamprecht at proxmox.com
Fri Jan 22 18:30:34 CET 2016
On 01/22/2016 06:24 PM, Dietmar Maurer wrote:
>> +sub upid_wait {
>> + my ($upid, $waitfunc, $sleep_intervall) = @_;
>> +
>> + my $task = upid_decode($upid);
>> +
>> + $sleep_intervall = $sleep_intervall ? $sleep_intervall : 1;
>> +
>> + while (PVE::ProcFSTools::check_process_running($task->{pid},
>> $task->{pstart})) {
>> +
>> + &$waitfunc($task) if $waitfunc && ref($waitfunc) eq 'CODE';
> I would completely remove this waitfunc() code.
>
> If someone need this, he can implement the loop himself..
>
> sub upid_wait {
> my ($upid) = @_;
> ...
Hmm, understandable, but then my initial use case (waiting for task in
the HA resource methods and logging active task information, like done
until yet) for this goes away.
More information about the pve-devel
mailing list