Revision a16a7068
Von Moritz Bunkus vor etwa 12 Jahren hinzugefügt
SL/DB/Manager/BackgroundJob.pm | ||
---|---|---|
5 | 5 |
use SL::DB::Helper::Manager; |
6 | 6 |
use base qw(SL::DB::Helper::Manager); |
7 | 7 |
|
8 |
use SL::DB::Helper::Sorted; |
|
9 |
|
|
8 | 10 |
sub object_class { 'SL::DB::BackgroundJob' } |
9 | 11 |
|
10 | 12 |
__PACKAGE__->make_manager_methods; |
11 | 13 |
|
14 |
sub _sort_spec { |
|
15 |
return ( default => [ 'next_run_at', 1 ], |
|
16 |
columns => { SIMPLE => 'ALL' } ); |
|
17 |
} |
|
18 |
|
|
12 | 19 |
sub cleanup { |
13 | 20 |
my $class = shift; |
14 | 21 |
$class->delete_all(where => [ and => [ type => 'once', last_run_at => { lt => DateTime->now_local->subtract(days => '1') } ] ]); |
Auch abrufbar als: Unified diff
BackgroundJob-Manager sortierbar machen