X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/4e4bd8f9d9b5c89d42829011786d3766a0b926bf..b6fd15a8dc44f9b09d5a2bce766cda14b87c6e13:/SL/DB/BackgroundJob.pm diff --git a/SL/DB/BackgroundJob.pm b/SL/DB/BackgroundJob.pm index ce1c3991d..9f2f7cb05 100644 --- a/SL/DB/BackgroundJob.pm +++ b/SL/DB/BackgroundJob.pm @@ -10,7 +10,6 @@ use SL::DB::Manager::BackgroundJob; use SL::DB::BackgroundJobHistory; -use SL::BackgroundJob::Test; use SL::System::Process; __PACKAGE__->before_save('_before_save_set_next_run_at'); @@ -38,6 +37,7 @@ sub run { my $history; my $ok = eval { + eval "require $package" or die $@; my $result = $package->new->run($self); $history = SL::DB::BackgroundJobHistory @@ -90,7 +90,7 @@ sub validate { } eval { - DateTime::Event::Cron->new_from_cron($self->cron_spec)->next(DateTime->now_local); + DateTime::Event::Cron->new_from_cron($self->cron_spec || '* * * * *')->next(DateTime->now_local); 1; } or push @errors, $::locale->text('The execution schedule is invalid.');