Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

change how prefork is being used a bit

  • Loading branch information...
commit 7e95b1931900b80dc6ec24e4fef82ffb5b13a91e 1 parent 009e4c5
lestrrat lestrrat authored
Showing with 5 additions and 10 deletions.
  1. +1 −1  Makefile.PL
  2. +4 −9 lib/STF/Worker/Drone.pm
2  Makefile.PL
View
@@ -57,7 +57,7 @@ WriteMakefile(
'Plack' => '0.9981',
'Plack::Middleware::ReverseProxy' => 0,
'Plack::Middleware::Static' => 0,
- 'Parallel::Prefork' => 0,
+ 'Parallel::Prefork' => '0.10',
'Parallel::ForkManager' => 0,
'Parallel::Scoreboard' => 0,
'Router::Simple' => 0,
13 lib/STF/Worker/Drone.pm
View
@@ -60,7 +60,7 @@ has scoreboard => (
has spawn_interval => (
is => 'rw',
- default => 1
+ default => 5
);
has workers => (
@@ -166,17 +166,12 @@ sub run {
my $scoreboard = $self->scoreboard; # load to initialize;
my $pp = $self->process_manager();
while ( $pp->signal_received !~ /^(?:TERM|INT)$/ ) {
- $pp->start and next;
- eval {
+ $pp->start(sub {
$self->start_worker( $self->get_worker() );
- };
- if ($@) {
- warn "Failed to start worker ($$): $@";
- }
- print STDERR "Worker ($$) exit\n";
- $pp->finish;
+ });
}
+ $pp->signal_all_children('TERM');
$self->cleanup();
}
Please sign in to comment.
Something went wrong with that request. Please try again.