X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FDB%2FBackgroundJob.pm;h=b567d364e8bcdaf4c8e7c7dc993288c235e78566;hb=17384c044b465c262772eb9737ea298069c4d826;hp=f5c4b21f68d2d4b3b67c071c91856b3b2d89b978;hpb=7c60c2423f6fd27a78cf89ca62821ea1e41e85f5;p=kivitendo-erp.git diff --git a/SL/DB/BackgroundJob.pm b/SL/DB/BackgroundJob.pm index f5c4b21f6..b567d364e 100644 --- a/SL/DB/BackgroundJob.pm +++ b/SL/DB/BackgroundJob.pm @@ -10,6 +10,8 @@ use SL::DB::Manager::BackgroundJob; use SL::System::Process; +__PACKAGE__->meta->initialize; + __PACKAGE__->before_save('_before_save_set_next_run_at'); sub _before_save_set_next_run_at { @@ -43,7 +45,7 @@ sub run { $history = SL::DB::BackgroundJobHistory ->new(package_name => $self->package_name, run_at => $run_at, - status => 'success', + status => SL::DB::BackgroundJobHistory::SUCCESS(), result => $result, data => $self->data); $history->save; @@ -56,7 +58,7 @@ sub run { $history = SL::DB::BackgroundJobHistory ->new(package_name => $self->package_name, run_at => $run_at, - status => 'failure', + status => SL::DB::BackgroundJobHistory::FAILURE(), error_col => $error, data => $self->data); $history->save;