From: Sven Schöling Date: Tue, 30 Oct 2012 11:00:37 +0000 (+0100) Subject: BackgroundJobCleanup X-Git-Tag: release-3.1.0beta1~739 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=19bc00f2f06ffa53668f39e55915b9b0df3970ba;p=kivitendo-erp.git BackgroundJobCleanup --- diff --git a/SL/BackgroundJob/ALL.pm b/SL/BackgroundJob/ALL.pm index 5688d2cc8..84c55ee00 100644 --- a/SL/BackgroundJob/ALL.pm +++ b/SL/BackgroundJob/ALL.pm @@ -3,6 +3,7 @@ package SL::BackgroundJob::ALL; use strict; use SL::BackgroundJob::Base; +use SL::BackgroundJob::BackgroundJobCleanup; use SL::BackgroundJob::CleanBackgroundJobHistory; use SL::BackgroundJob::CreatePeriodicInvoices; diff --git a/SL/BackgroundJob/BackgroundJobCleanup.pm b/SL/BackgroundJob/BackgroundJobCleanup.pm new file mode 100644 index 000000000..7d1a58a67 --- /dev/null +++ b/SL/BackgroundJob/BackgroundJobCleanup.pm @@ -0,0 +1,46 @@ +package SL::BackgroundJob::BackgroundJobCleanup; + +use strict; + +use parent qw(SL::BackgroundJob::Base); + +use SL::DB::BackgroundJob; + +sub create_job { + $_[0]->create_standard_job('0 3 * * *'); # daily at 3:00 am +} + +sub run { + SL::DB::Manager::BackgroundJob->cleanup; + + return 1; +} + +1; + +__END__ + +=encoding utf8 + +=head1 NAME + +SL::BackgroundJob::BackgroundJobCleanup - Background job for +cleaning the background job table of all executed one time jobs + +=head1 SYNOPSIS + +This background job deletes old entries from the table +C. This happens to background jobs that were +supposed to run only once and were already run. + +The job is supposed to run once a day. + +=head1 BUGS + +Nothing here yet. + +=head1 AUTHOR + +Sven Schöling Es.schoeling@linet-services.deE + +=cut diff --git a/sql/Pg-upgrade2/background_jobs_3.pl b/sql/Pg-upgrade2/background_jobs_3.pl new file mode 100644 index 000000000..0236cd55b --- /dev/null +++ b/sql/Pg-upgrade2/background_jobs_3.pl @@ -0,0 +1,13 @@ +#!/usr/bin/perl +# @tag: background_jobs_3 +# @description: Backgroundjob Cleanup einrichten +# @depends: emmvee_background_jobs_2 +# @charset: utf-8 + +use strict; + +use SL::BackgroundJob::BackgroundJobCleanup; + +SL::BackgroundJob::BackgroundJobCleanup->create_job; + +1;