Revision 19bc00f2
Von Sven Schöling vor fast 12 Jahren hinzugefügt
SL/BackgroundJob/ALL.pm | ||
---|---|---|
3 | 3 |
use strict; |
4 | 4 |
|
5 | 5 |
use SL::BackgroundJob::Base; |
6 |
use SL::BackgroundJob::BackgroundJobCleanup; |
|
6 | 7 |
use SL::BackgroundJob::CleanBackgroundJobHistory; |
7 | 8 |
use SL::BackgroundJob::CreatePeriodicInvoices; |
8 | 9 |
|
SL/BackgroundJob/BackgroundJobCleanup.pm | ||
---|---|---|
1 |
package SL::BackgroundJob::BackgroundJobCleanup; |
|
2 |
|
|
3 |
use strict; |
|
4 |
|
|
5 |
use parent qw(SL::BackgroundJob::Base); |
|
6 |
|
|
7 |
use SL::DB::BackgroundJob; |
|
8 |
|
|
9 |
sub create_job { |
|
10 |
$_[0]->create_standard_job('0 3 * * *'); # daily at 3:00 am |
|
11 |
} |
|
12 |
|
|
13 |
sub run { |
|
14 |
SL::DB::Manager::BackgroundJob->cleanup; |
|
15 |
|
|
16 |
return 1; |
|
17 |
} |
|
18 |
|
|
19 |
1; |
|
20 |
|
|
21 |
__END__ |
|
22 |
|
|
23 |
=encoding utf8 |
|
24 |
|
|
25 |
=head1 NAME |
|
26 |
|
|
27 |
SL::BackgroundJob::BackgroundJobCleanup - Background job for |
|
28 |
cleaning the background job table of all executed one time jobs |
|
29 |
|
|
30 |
=head1 SYNOPSIS |
|
31 |
|
|
32 |
This background job deletes old entries from the table |
|
33 |
C<background_jobs>. This happens to background jobs that were |
|
34 |
supposed to run only once and were already run. |
|
35 |
|
|
36 |
The job is supposed to run once a day. |
|
37 |
|
|
38 |
=head1 BUGS |
|
39 |
|
|
40 |
Nothing here yet. |
|
41 |
|
|
42 |
=head1 AUTHOR |
|
43 |
|
|
44 |
Sven Schöling E<lt>s.schoeling@linet-services.deE<gt> |
|
45 |
|
|
46 |
=cut |
sql/Pg-upgrade2/background_jobs_3.pl | ||
---|---|---|
1 |
#!/usr/bin/perl |
|
2 |
# @tag: background_jobs_3 |
|
3 |
# @description: Backgroundjob Cleanup einrichten |
|
4 |
# @depends: emmvee_background_jobs_2 |
|
5 |
# @charset: utf-8 |
|
6 |
|
|
7 |
use strict; |
|
8 |
|
|
9 |
use SL::BackgroundJob::BackgroundJobCleanup; |
|
10 |
|
|
11 |
SL::BackgroundJob::BackgroundJobCleanup->create_job; |
|
12 |
|
|
13 |
1; |
Auch abrufbar als: Unified diff
BackgroundJobCleanup