BackgroundJob-Hilfsfunktionen
[kivitendo-erp.git] / SL / DB / BackgroundJob.pm
1 package SL::DB::BackgroundJob;
2
3 use strict;
4
5 use DateTime::Event::Cron;
6
7 use SL::DB::MetaSetup::BackgroundJob;
8 use SL::DB::Manager::BackgroundJob;
9
10 sub update_next_run_at {
11   my $self = shift;
12
13   my $cron = DateTime::Event::Cron->new_from_cron($self->cron_spec || '* * * * *');
14   $self->update_attributes(next_run_at => $cron->next->set_time_zone($::locale->get_local_time_zone));
15   return $self;
16 }
17
18 1;