X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/295e585ae307aa9b4d7f5028187d1954b44e76af..782fd7884fb686cd2e336756dadeb4ab5d05a415:/SL/DB/BackgroundJob.pm diff --git a/SL/DB/BackgroundJob.pm b/SL/DB/BackgroundJob.pm index e6b099f55..f4edf2d30 100644 --- a/SL/DB/BackgroundJob.pm +++ b/SL/DB/BackgroundJob.pm @@ -1,13 +1,18 @@ -# This file has been auto-generated only because it didn't exist. -# Feel free to modify it at will; it will not be overwritten automatically. - package SL::DB::BackgroundJob; use strict; +use DateTime::Event::Cron; + use SL::DB::MetaSetup::BackgroundJob; +use SL::DB::Manager::BackgroundJob; + +sub update_next_run_at { + my $self = shift; -# Creates get_all, get_all_count, get_all_iterator, delete_all and update_all. -__PACKAGE__->meta->make_manager_class; + my $cron = DateTime::Event::Cron->new_from_cron($self->cron_spec || '* * * * *'); + $self->update_attributes(next_run_at => $cron->next->set_time_zone($::locale->get_local_time_zone)); + return $self; +} 1;