Skip to content

Commit

Permalink
small optimizations
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Jan 17, 2013
1 parent c0e6cd1 commit 6205af0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 2 additions & 0 deletions Changes
Expand Up @@ -2,6 +2,8 @@
3.81 2013-01-17
- Added modules Mojo::Server::Prefork and Mojolicious::Command::prefork.
- Updated jQuery to version 1.9.
- Improved Mojo::Server::Hypnotoad to be a small wrapper around
Mojo::Server::Prefork.
- Improved documentation.
- Improved tests.
- Fixed small memory leak in Hypnotoad that only shows when Perl is compiled
Expand Down
13 changes: 6 additions & 7 deletions lib/Mojo/Server/Hypnotoad.pm
Expand Up @@ -75,17 +75,16 @@ sub _config {

# Prefork settings
$ENV{MOJO_REVERSE_PROXY} = $c->{proxy} if defined $c->{proxy};
my $prefork = $self->{prefork};
$prefork->pid_file($c->{pid_file}
|| catfile(dirname($ENV{HYPNOTOAD_APP}), 'hypnotoad.pid'));
my $prefork = $self->{prefork}->listen($c->{listen} || ['http://*:8080']);
my $file = catfile dirname($ENV{HYPNOTOAD_APP}), 'hypnotoad.pid';
$prefork->pid_file($c->{pid_file} || $file);
$prefork->max_clients($c->{clients}) if $c->{clients};
$prefork->max_requests($c->{keep_alive_requests})
if $c->{keep_alive_requests};
defined $c->{$_} and $prefork->$_($c->{$_})
for qw(accept_interval accepts backlog graceful_timeout group),
qw(heartbeat_interval heartbeat_timeout inactivity_timeout lock_file),
qw(lock_timeout multi_accept user workers);
$prefork->max_clients($c->{clients}) if $c->{clients};
$prefork->max_requests($c->{keep_alive_requests})
if $c->{keep_alive_requests};
$prefork->listen($c->{listen} || ['http://*:8080']);
}

sub _exit { say shift and exit 0 }
Expand Down

0 comments on commit 6205af0

Please sign in to comment.