Try to get deleted session count from Session module (#2428)

This commit is contained in:
Maxime Besson 2021-08-06 17:55:55 +02:00
parent 87f27fe0d7
commit ac5ce7ed97
1 changed files with 9 additions and 3 deletions

View File

@ -144,8 +144,7 @@ for my $options (@backends) {
next if ( $options->{backend} eq "Apache::Session::Memcached" );
my @t;
if ( $options->{backend}->can('deleteIfLowerThan') ) {
next
if $options->{backend}->deleteIfLowerThan(
my ( $success, $rows ) = $options->{backend}->deleteIfLowerThan(
$options,
{
not => { '_session_kind' => 'Persistent' },
@ -158,7 +157,14 @@ for my $options (@backends) {
)
}
}
);
);
if ($success) {
if ($rows) {
$nb_purged += $rows;
}
next;
}
}
# Get all expired sessions