Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
better log messages for prefork server
  • Loading branch information
kraih committed Jan 16, 2013
1 parent a5d572b commit 1b6fd05
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
5 changes: 1 addition & 4 deletions lib/Mojo/Server/Hypnotoad.pm
Expand Up @@ -61,11 +61,8 @@ sub run {
open STDERR, '>&STDOUT';
}

# Clean manager environment
local $SIG{USR2} = sub { $self->{upgrade} ||= time };

# Start accepting connections
$app->log->info(qq[Hypnotoad server $$ started for "$ENV{HYPNOTOAD_APP}".]);
local $SIG{USR2} = sub { $self->{upgrade} ||= time };
$prefork->run;
}

Expand Down
6 changes: 2 additions & 4 deletions lib/Mojo/Server/Prefork.pm
Expand Up @@ -41,9 +41,6 @@ sub run {
my $loop = $self->ioloop->max_accepts($self->accepts);
$loop->$_($self->$_) for qw(accept_interval multi_accept);

# Preload application and start accepting connections
$self->start->app;

# Pipe for worker communication
pipe($self->{reader}, $self->{writer}) or die "Can't create pipe: $!";
$self->{poll} = IO::Poll->new;
Expand All @@ -62,7 +59,8 @@ sub run {
$self->{pool}{shuffle keys %{$self->{pool}}}{graceful} ||= time;
};

# Mainloop
# Preload application and start accepting connections
$self->start->app->log->info("Manager $$ started.");
$self->{running} = 1;
$self->_manage while $self->{running};
}
Expand Down

0 comments on commit 1b6fd05

Please sign in to comment.