From a75f4558de7272a5c2a641687c0baa1e8f4bb190 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Thu, 10 Jul 2014 09:51:33 +0200 Subject: [PATCH] =?utf8?q?Hintergrundjob=20zum=20L=C3=B6schen=20abgelaufen?= =?utf8?q?er=20Sessions?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/BackgroundJob/CleanAuthSessions.pm | 47 +++++++++++++++++++ .../background_jobs_clean_auth_sessions.pl | 21 +++++++++ 2 files changed, 68 insertions(+) create mode 100644 SL/BackgroundJob/CleanAuthSessions.pm create mode 100644 sql/Pg-upgrade2/background_jobs_clean_auth_sessions.pl 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; -- 2.20.1