Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision a75f4558

Von Moritz Bunkus vor mehr als 10 Jahren hinzugefügt

  • ID a75f4558de7272a5c2a641687c0baa1e8f4bb190
  • Vorgänger b1cf0c0b
  • Nachfolger b3a47a99

Hintergrundjob zum Löschen abgelaufener Sessions

Unterschiede anzeigen:

SL/BackgroundJob/CleanAuthSessions.pm
1
package SL::BackgroundJob::CleanAuthSessions;
2

  
3
use strict;
4

  
5
use parent qw(SL::BackgroundJob::Base);
6

  
7
sub create_job {
8
  $_[0]->create_standard_job('30 6 * * *'); # daily at 6:30 am
9
}
10

  
11
sub run {
12
  my ($self) = @_;
13

  
14
  $::auth->expire_sessions;
15

  
16
  return 1;
17
}
18

  
19
1;
20

  
21
__END__
22

  
23
=encoding utf8
24

  
25
=head1 NAME
26

  
27
SL::BackgroundJob::CleanAuthSessions - Background job for cleaning the
28
session tables of expired entries
29

  
30
=head1 SYNOPSIS
31

  
32
This background job deletes all entries for expired sessions from the
33
tables C<auth.session> and C<auth.session_content>. It will also
34
delete all files associated with that session (see
35
L<SL::SessionFile>).
36

  
37
The job is supposed to run once a day.
38

  
39
=head1 BUGS
40

  
41
Nothing here yet.
42

  
43
=head1 AUTHOR
44

  
45
Moritz Bunkus E<lt>m.bunkus@linet-services.deE<gt>
46

  
47
=cut
sql/Pg-upgrade2/background_jobs_clean_auth_sessions.pl
1
# @tag: background_jobs_clean_auth_sessions
2
# @description: Hintergrundjob zum Löschen abgelaufener Sessions
3
# @depends: release_3_1_0
4
package SL::DBUpgrade2::background_jobs_clean_auth_sessions;
5

  
6
use strict;
7
use utf8;
8

  
9
use parent qw(SL::DBUpgrade2::Base);
10

  
11
use SL::BackgroundJob::CleanAuthSessions;
12

  
13
sub run {
14
  my ($self) = @_;
15

  
16
  SL::BackgroundJob::CleanAuthSessions->create_job;
17

  
18
  return 1;
19
}
20

  
21
1;

Auch abrufbar als: Unified diff