insert hack for MCE __DIE__ problem

This commit is contained in:
Oliver Gorwits
2013-01-02 16:04:10 +00:00
parent 9e1bc7d6d7
commit 8d9ede6717

View File

@@ -26,6 +26,7 @@ my $mce = MCE->new(
user_tasks => build_tasks_list(), user_tasks => build_tasks_list(),
)->run(); )->run();
sub call_worker_body { sub call_worker_body {
my ($self) = @_; my ($self) = @_;
$self->worker_body; $self->worker_body;
@@ -68,6 +69,7 @@ sub worker_factory {
return sub { return sub {
my $self = shift; my $self = shift;
Role::Tiny->apply_roles_to_object($self, "App::Netdisco::Daemon::Worker::$role"); Role::Tiny->apply_roles_to_object($self, "App::Netdisco::Daemon::Worker::$role");
$SIG{__DIE__} = sub { return @_ if $^S eq 1; $SIG{__DIE__}->(@_) };
$self->worker_begin if $self->can('worker_begin'); $self->worker_begin if $self->can('worker_begin');
}; };
} }