]> git.proxmox.com Git - pve-manager-legacy.git/commitdiff
pvescheduler: use private sub instead of code-ref
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 23 Nov 2021 07:59:49 +0000 (08:59 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 23 Nov 2021 07:59:49 +0000 (08:59 +0100)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
PVE/Service/pvescheduler.pm

index 2acb09b968d1973a6014c9595090d755c2c82ecf..f05f3bb91238836cd8a955e2e6d2c11c6308a341 100755 (executable)
@@ -25,7 +25,7 @@ my sub running_job_pids : prototype($) {
     return scalar($pids->@*) ? $pids : undef;
 }
 
-my $finish_jobs = sub {
+my sub finish_jobs : prototype($) {
     my ($self) = @_;
     for my $type (@JOB_TYPES) {
        for my $cpid (keys $self->{jobs}->{$type}->%*) {
@@ -69,7 +69,7 @@ sub run {
     my $old_sig_chld = $SIG{CHLD};
     local $SIG{CHLD} = sub {
        local ($@, $!, $?); # do not overwrite error vars
-       $finish_jobs->($self);
+       finish_jobs($self);
        $old_sig_chld->(@_) if $old_sig_chld;
     };
 
@@ -143,7 +143,7 @@ sub run {
     while(my $pids = running_job_pids($self)) {
        kill 'TERM', $pids->@*; # send TERM to all workers at once, possible thundering herd - FIXME?
 
-       $finish_jobs->($self);
+       finish_jobs($self);
 
        # some jobs have a lock timeout of 60s, wait a bit more for graceful termination
        last if $timeout > 75;