Bugzilla – Attachment 6006 Details for
Bug 7042
Improving cleanup_database.pl: handling quotes in a_session and interpreting sessdays parameter
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Sign-off patch
0001-7042-Improving-cleanup_database.pl-handling-quotes-i.patch (text/plain), 2.22 KB, created by
Ian Bays
on 2011-10-20 08:20:19 UTC
(
hide
)
Description:
Sign-off patch
Filename:
MIME Type:
Creator:
Ian Bays
Created:
2011-10-20 08:20:19 UTC
Size:
2.22 KB
patch
obsolete
>From 236b6496cf19bffcb8811b0db151d30f83df9d08 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Mon, 17 Oct 2011 11:32:50 +0200 >Subject: [PATCH] 7042 Improving cleanup_database.pl: handling quotes in a_session and interpreting sessdays parameter > >Improving the cleanup_database.pl script in two aspects: >1) In some cases CGI::Session seems to place quotes around the atime and ctime >data in the a_session field. Two regexps now take this into account. >2) If the --sessdays parameter is used, the --sessions parameter is now >implicitly enabled too. > >With thanks to Ian Bays and Tom Hanstra. > >Signed-off-by: Ian Bays <ian.bays@ptfs-europe.com> >--- > misc/cronjobs/cleanup_database.pl | 7 ++++--- > 1 files changed, 4 insertions(+), 3 deletions(-) > >diff --git a/misc/cronjobs/cleanup_database.pl b/misc/cronjobs/cleanup_database.pl >index 1333111..ba2a6d8 100755 >--- a/misc/cronjobs/cleanup_database.pl >+++ b/misc/cronjobs/cleanup_database.pl >@@ -44,7 +44,7 @@ Usage: $0 [-h|--help] [--sessions] [--sessdays DAYS] [-v|--verbose] [--zebraqueu > other options > --sessions purge the sessions table. If you use this while users > are logged into Koha, they will have to reconnect. >- --sessdays DAYS purge only sessions older than DAYS days (use together with sessions parameter). >+ --sessdays DAYS purge only sessions older than DAYS days. > -v --verbose will cause the script to give you a bit more information > about the run. > --zebraqueue DAYS purge completed entries from the zebraqueue from >@@ -64,6 +64,7 @@ GetOptions( > 'm|mail' => \$mail, > 'zebraqueue:i' => \$zebraqueue_days, > ) || usage(1); >+$sessions=1 if $sess_days && $sess_days>0; > > if ($help) { > usage(0); >@@ -148,9 +149,9 @@ sub RemoveOldSessions { > > while ( $sth->fetch ) { > $lasttime = 0; >- if ( $a_session =~ /lasttime:\s+(\d+)/ ) { >+ if ( $a_session =~ /lasttime:\s+'?(\d+)/ ) { > $lasttime = $1; >- } elsif ( $a_session =~ /(ATIME|CTIME):\s+(\d+)/ ) { >+ } elsif ( $a_session =~ /(ATIME|CTIME):\s+'?(\d+)/ ) { > $lasttime = $2; > } > if ( $lasttime && $lasttime < $limit ) { >-- >1.6.4.4 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 7042
:
5919
| 6006