[Rt-commit] rt branch 4.4/add-clean-sessions-all-option created. rt-4.4.5-22-g4168b60709
BPS Git Server
git at git.bestpractical.com
Fri Jun 30 20:59:33 UTC 2023
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "rt".
The branch, 4.4/add-clean-sessions-all-option has been created
at 4168b60709ee06542ec1558fd003380ca183b85e (commit)
- Log -----------------------------------------------------------------
commit 4168b60709ee06542ec1558fd003380ca183b85e
Author: Brad Embree <brad at bestpractical.com>
Date: Thu Jan 27 15:43:44 2022 -0800
Add clean-all option
diff --git a/sbin/rt-clean-sessions.in b/sbin/rt-clean-sessions.in
index f4c0df2c36..b6826baa18 100644
--- a/sbin/rt-clean-sessions.in
+++ b/sbin/rt-clean-sessions.in
@@ -68,7 +68,7 @@ BEGIN { # BEGIN RT CMD BOILERPLATE
use Getopt::Long;
my %opt;
-GetOptions( \%opt, "older=s", "debug", "help|h", "skip-user" );
+GetOptions( \%opt, "older=s", "debug", "help|h", "skip-user", "clean-all" );
if ( $opt{help} ) {
@@ -106,7 +106,7 @@ RT::InitLogging();
require RT::Interface::Web::Session;
my $alogoff = int RT->Config->Get('AutoLogoff');
-if ( $opt{'older'} or $alogoff ) {
+if ( $opt{'older'} or $alogoff or $opt{'clean-all'} ) {
my $min;
foreach ($alogoff*60, $opt{'older'}) {
next unless $_;
@@ -114,6 +114,8 @@ if ( $opt{'older'} or $alogoff ) {
$min = $_ if $_ < $min;
}
+ $min = 0 if $opt{'clean-all'};
+
RT::Interface::Web::Session->ClearOld( $min );
}
@@ -130,13 +132,14 @@ rt-clean-sessions - clean old and duplicate RT sessions
=head1 SYNOPSIS
- rt-clean-sessions [--debug] [--older <NUM>[H|D|M|Y]]
+ rt-clean-sessions [--debug] [--older <NUM>[H|D|M|Y]] [--skip-user] [--clean-all]
rt-clean-sessions
rt-clean-sessions --debug
rt-clean-sessions --older 10D
rt-clean-sessions --debug --older 1M
rt-clean-sessions --older 10D --skip-user
+ rt-clean-sessions --clean-all
=head1 DESCRIPTION
@@ -164,6 +167,10 @@ By default only one session per user left in the DB, so users that have
sessions on multiple computers or in different browsers will be logged out.
Use this option to avoid this.
+=item clean-all
+
+Use this option to clear all sessions.
+
=item debug
Turn on debug output.
-----------------------------------------------------------------------
hooks/post-receive
--
rt
More information about the rt-commit
mailing list