X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/7c60c2423f6fd27a78cf89ca62821ea1e41e85f5..626d6b3823bf6e92c5f38c869f4923f5325b0ffe:/SL/DB/BackgroundJob.pm diff --git a/SL/DB/BackgroundJob.pm b/SL/DB/BackgroundJob.pm index f5c4b21f6..10e319ba3 100644 --- a/SL/DB/BackgroundJob.pm +++ b/SL/DB/BackgroundJob.pm @@ -5,11 +5,15 @@ use strict; use DateTime::Event::Cron; use English qw(-no_match_vars); +use Rose::DB::Object::Helpers qw(as_tree); + use SL::DB::MetaSetup::BackgroundJob; 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 +47,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 +60,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;