From: Moritz Bunkus Date: Thu, 10 Jul 2014 07:51:33 +0000 (+0200) Subject: Hintergrundjob zum Löschen abgelaufener Sessions X-Git-Tag: release-3.2.0beta~396 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=a75f4558de7272a5c2a641687c0baa1e8f4bb190;p=kivitendo-erp.git Hintergrundjob zum Löschen abgelaufener Sessions --- diff --git a/SL/BackgroundJob/CleanAuthSessions.pm b/SL/BackgroundJob/CleanAuthSessions.pm new file mode 100644 index 000000000..8510902bb --- /dev/null +++ b/SL/BackgroundJob/CleanAuthSessions.pm @@ -0,0 +1,47 @@ +package SL::BackgroundJob::CleanAuthSessions; + +use strict; + +use parent qw(SL::BackgroundJob::Base); + +sub create_job { + $_[0]->create_standard_job('30 6 * * *'); # daily at 6:30 am +} + +sub run { + my ($self) = @_; + + $::auth->expire_sessions; + + return 1; +} + +1; + +__END__ + +=encoding utf8 + +=head1 NAME + +SL::BackgroundJob::CleanAuthSessions - Background job for cleaning the +session tables of expired entries + +=head1 SYNOPSIS + +This background job deletes all entries for expired sessions from the +tables C and C. It will also +delete all files associated with that session (see +L). + +The job is supposed to run once a day. + +=head1 BUGS + +Nothing here yet. + +=head1 AUTHOR + +Moritz Bunkus Em.bunkus@linet-services.deE + +=cut diff --git a/sql/Pg-upgrade2/background_jobs_clean_auth_sessions.pl b/sql/Pg-upgrade2/background_jobs_clean_auth_sessions.pl new file mode 100644 index 000000000..cab9196e9 --- /dev/null +++ b/sql/Pg-upgrade2/background_jobs_clean_auth_sessions.pl @@ -0,0 +1,21 @@ +# @tag: background_jobs_clean_auth_sessions +# @description: Hintergrundjob zum Löschen abgelaufener Sessions +# @depends: release_3_1_0 +package SL::DBUpgrade2::background_jobs_clean_auth_sessions; + +use strict; +use utf8; + +use parent qw(SL::DBUpgrade2::Base); + +use SL::BackgroundJob::CleanAuthSessions; + +sub run { + my ($self) = @_; + + SL::BackgroundJob::CleanAuthSessions->create_job; + + return 1; +} + +1;