[pve-devel] [PATCH common v2 3/3] daemon: terminate_server reduce code reuse

Thomas Lamprecht t.lamprecht at proxmox.com
Fri Nov 10 12:09:29 CET 2017


Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---
 src/PVE/Daemon.pm | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/src/PVE/Daemon.pm b/src/PVE/Daemon.pm
index 55a03fc..d7f9a27 100644
--- a/src/PVE/Daemon.pm
+++ b/src/PVE/Daemon.pm
@@ -192,15 +192,10 @@ my $terminate_server = sub {
 
     $self->{terminate} = 1; # set flag to avoid worker restart
 
-    if (!$self->{max_workers}) {
-	eval { $self->shutdown(); };
-	warn $@ if $@;
-	return;
-    }
-
     eval { $self->shutdown(); };
     warn $@ if $@;
 
+    return if !$self->{max_workers}; # if we have no workers we're done here
 
     # if configured, leave children running on HUP
     return if $allow_open_children && $self->{leave_children_open_on_reload};
-- 
2.11.0





More information about the pve-devel mailing list