Skip to content

Commit

Permalink
improved Hypnotoad to clean up old PID files containing a 0
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Sep 18, 2012
1 parent 300d8a5 commit 017aac5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion Changes
@@ -1,5 +1,6 @@

3.43 2012-09-17
3.43 2012-09-18
- Improved Hypnotoad to clean up old PID files containing a 0.
- Improved documentation.

3.42 2012-09-16
Expand Down
4 changes: 2 additions & 2 deletions lib/Mojo/Server/Hypnotoad.pm
Expand Up @@ -148,9 +148,9 @@ sub _hot_deploy {
my $self = shift;

# Make sure server is running and clean up PID file if necessary
return unless my $pid = $self->_pid;
return unless defined(my $pid = $self->_pid);
my $file = $self->{config}{pid_file};
return -w $file ? unlink $file : undef unless kill 0, $pid;
return -w $file ? unlink $file : undef unless $pid && kill 0, $pid;

# Start hot deployment
kill 'USR2', $pid;
Expand Down

0 comments on commit 017aac5

Please sign in to comment.