X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/db4680753f5ec1de62bdc0557f850afd810444d1..48c71a4b51f5359a7ab7e9bc51280baf9bc9b9b2:/SL/BackgroundJob/SelfTest.pm?ds=sidebyside diff --git a/SL/BackgroundJob/SelfTest.pm b/SL/BackgroundJob/SelfTest.pm index c1c608bbf..d341e64df 100644 --- a/SL/BackgroundJob/SelfTest.pm +++ b/SL/BackgroundJob/SelfTest.pm @@ -48,18 +48,11 @@ sub setup { sub run { my $self = shift; - my $db_obj = shift; - # options - my $options = $db_obj->data_as_hash; $self->setup; return 1 unless $self->modules; - - $main::lxdebug->message(0, 'optioni' . Dumper($self->modules)); foreach my $module ($self->modules) { - next unless $module eq $options->{module}; - $main::lxdebug->message(0, 'hieur' . $module); $self->run_module($module); } @@ -70,8 +63,9 @@ sub run { $self->aggreg->failed, $self->aggreg->todo_passed, ); - - if (!$self->aggreg->all_passed || $self->config->{send_email_on_success}) { + # if (!$self->aggreg->all_passed || $self->config->{send_email_on_success}) { + # all_passed is not set or calculated (anymore). it is safe to check only for probs or errors + if ($self->aggreg->failed || $self->config->{send_email_on_success}) { $self->_send_email; } @@ -140,13 +134,14 @@ sub _send_email { $mail->{content_type} = $content_type; $mail->{message} = $$output; - $mail->send; + my $err = $mail->send; + $self->add_errors('Mailer error #1', $err) if $err; + } sub _prepare_report { my ($self) = @_; - my $user = $self->_email_user; my $template = Template->new({ 'INTERPOLATE' => 0, 'EVAL_PERL' => 0, 'ABSOLUTE' => 1,