Skip to content

Commit

Permalink
fixed Hypnotoad to clean up lock files
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Sep 6, 2011
1 parent 4c95280 commit 89fda4b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions Changes
Expand Up @@ -3,6 +3,7 @@ This file documents the revision history for Perl extension Mojolicious.
1.98 2011-09-06 00:00:00
- Improved tests.
- Fixed small bug in cookie jar.
- Fixed Hypnotoad to clean up lock files.

1.97 2011-09-03 00:00:00
- Improved unicode handling to be more correct and less forgiving.
Expand Down
7 changes: 4 additions & 3 deletions lib/Mojo/Server/Hypnotoad.pm
Expand Up @@ -25,8 +25,8 @@ sub DESTROY {
return unless $self->{done};

# Manager
return unless my $file = $self->{config}->{pid_file};
unlink $file if -w $file;
if (my $file = $self->{config}->{pid_file}) { unlink $file if -w $file }
if (my $file = $self->{config}->{lock_file}) { unlink $file if -w $file }
}

# "Marge? Since I'm not talking to Lisa,
Expand Down Expand Up @@ -149,7 +149,8 @@ sub _config {
$c->{heartbeat_timeout} ||= 5;
$c->{lock_file}
||= File::Spec->catfile($ENV{MOJO_TMPDIR} || File::Spec->tmpdir,
"hypnotoad.$$.lock");
'hypnotoad.lock');
$c->{lock_file} .= ".$$";
$c->{pid_file}
||= File::Spec->catfile(dirname($ENV{HYPNOTOAD_APP}), 'hypnotoad.pid');
$c->{upgrade_timeout} ||= 30;
Expand Down

0 comments on commit 89fda4b

Please sign in to comment.