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;
}
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.');