projects
/
kivitendo-erp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of vc.linet-services.de:public/lx-office-erp
[kivitendo-erp.git]
/
SL
/
DB
/
BackgroundJob.pm
diff --git
a/SL/DB/BackgroundJob.pm
b/SL/DB/BackgroundJob.pm
index
b9e00c4
..
743a6b5
100644
(file)
--- a/
SL/DB/BackgroundJob.pm
+++ b/
SL/DB/BackgroundJob.pm
@@
-27,7
+27,7
@@
sub run {
my $run_at = DateTime->now_local;
my $history;
my $run_at = DateTime->now_local;
my $history;
- eval {
+
my $ok =
eval {
my $result = $package->new->run($self);
$history = SL::DB::BackgroundJobHistory
my $result = $package->new->run($self);
$history = SL::DB::BackgroundJobHistory
@@
-41,14
+41,17
@@
sub run {
1;
};
1;
};
- if ($EVAL_ERROR) {
+ if (!$ok) {
+ my $error = $EVAL_ERROR;
$history = SL::DB::BackgroundJobHistory
->new(package_name => $self->package_name,
run_at => $run_at,
status => 'failure',
$history = SL::DB::BackgroundJobHistory
->new(package_name => $self->package_name,
run_at => $run_at,
status => 'failure',
- error
=> $EVAL_ERROR
,
+ error
_col => $error
,
data => $self->data);
$history->save;
data => $self->data);
$history->save;
+
+ $::lxdebug->message(LXDebug->WARN(), "BackgroundJob ID " . $self->id . " execution error (first three lines): " . join("\n", (split(m/\n/, $error))[0..2]));
}
$self->assign_attributes(last_run_at => $run_at)->update_next_run_at;
}
$self->assign_attributes(last_run_at => $run_at)->update_next_run_at;