From: Moritz Bunkus Date: Tue, 3 Jun 2014 15:10:25 +0000 (+0200) Subject: Test-BackgroundJob: Möglichkeiten, das Ergebnis zu steuern X-Git-Tag: release-3.2.0beta~425 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=f7c4665fd435b94e599ea1ac2ba23d8e21a8420f;p=kivitendo-erp.git Test-BackgroundJob: Möglichkeiten, das Ergebnis zu steuern --- diff --git a/SL/BackgroundJob/Test.pm b/SL/BackgroundJob/Test.pm index f79a1b586..c8c76db36 100644 --- a/SL/BackgroundJob/Test.pm +++ b/SL/BackgroundJob/Test.pm @@ -5,10 +5,14 @@ use strict; use parent qw(SL::BackgroundJob::Base); sub run { - my $self = shift; - my $db_obj = shift; + my ($self, $db_obj) = @_; + my $data = $db_obj->data_as_hash; $::lxdebug->message(0, "Test job is being executed."); + + die "Oh cruel world: " . $data->{exception} if $data->{exception}; + + return exists $data->{result} ? $data->{result} : 1; } 1;