Skip to content

Commit

Permalink
Merge pull request #45 from azrle/master
Browse files Browse the repository at this point in the history
fix: ensure sleep KILL_OLD_DELAY
  • Loading branch information
kazuho committed Oct 28, 2016
2 parents 787d78b + f076c13 commit f10c90f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/Server/Starter.pm
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,9 @@ sub start_server {
my $kill_old_delay = defined $ENV{KILL_OLD_DELAY} ? $ENV{KILL_OLD_DELAY} : $ENV{ENABLE_AUTO_RESTART} ? 5 : 0;
if ($kill_old_delay != 0) {
print STDERR "sleeping $kill_old_delay secs before killing old workers\n";
sleep $kill_old_delay;
while ($kill_old_delay > 0) {
$kill_old_delay -= sleep $kill_old_delay || 1;
}
}
print STDERR "killing old workers\n";
kill $opts->{signal_on_hup}, $_
Expand Down

0 comments on commit f10c90f

Please sign in to comment.