projects
/
kivitendo-erp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Hintergrundjob-Validierung: 'keine Spec' als '* * * * *' behandeln
[kivitendo-erp.git]
/
SL
/
DB
/
BackgroundJob.pm
diff --git
a/SL/DB/BackgroundJob.pm
b/SL/DB/BackgroundJob.pm
index
18f8e42
..
b7b907b
100644
(file)
--- a/
SL/DB/BackgroundJob.pm
+++ b/
SL/DB/BackgroundJob.pm
@@
-13,6
+13,15
@@
use SL::DB::BackgroundJobHistory;
use SL::BackgroundJob::Test;
use SL::System::Process;
use SL::BackgroundJob::Test;
use SL::System::Process;
+__PACKAGE__->before_save('_before_save_set_next_run_at');
+
+sub _before_save_set_next_run_at {
+ my ($self) = @_;
+
+ $self->update_next_run_at if !$self->next_run_at;
+ return 1;
+}
+
sub update_next_run_at {
my $self = shift;
sub update_next_run_at {
my $self = shift;
@@
-81,7
+90,7
@@
sub validate {
}
eval {
}
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.');
1;
} or push @errors, $::locale->text('The execution schedule is invalid.');