PriceSource: credit_notes auch im Popup unterstützen
[kivitendo-erp.git] / SL / DB / BackgroundJob.pm
index f5c4b21..b567d36 100644 (file)
@@ -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;