Cache reload throw an error if status enabled
Concerned version
Version: %2.0.X
Platform: Demo
Summary
At each reload, an error is thrown
Logs
[Sat Mar 28 18:35:50 2020] [LLNG:15291] [debug] Add POST route:
[Sat Mar 28 18:35:50 2020] [LLNG:15291] [debug] route 2fregisters added
[Sat Mar 28 18:35:50 2020] [LLNG:15291] [debug] Plugin ::2F::Engines::Default initializated
Status: Unknown command line : RELOADCACHE Cache::FileCache5
[Sat Mar 28 18:35:51 2020] [LLNG:15291] [debug] Module Lemonldap::NG::Portal::Plugins::MailPasswordReset loaded
[Sat Mar 28 18:35:51 2020] [LLNG:15291] [debug] Declaring unauth route
[Sat Mar 28 18:35:51 2020] [LLNG:15291] [debug] Add POST route:
[Sat Mar 28 18:35:51 2020] [LLNG:15291] [debug] route resetpwd added
Possible fixes
Seems scalar context is used by map directive (5 = number of cache module parameters instead of concatenation string)
lemonldap-ng/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Main/Reload.pm
# Local session storage
if ( $conf->{localSessionStorage} ) {
$class->tsv->{sessionCacheModule} = $conf->{localSessionStorage};
$class->tsv->{sessionCacheOptions} =
$conf->{localSessionStorageOptions};
$class->tsv->{sessionCacheOptions}->{default_expires_in} ||= 600;
if ( $conf->{status} ) {
my $params = "";
if ( $class->tsv->{sessionCacheModule} ) {
$params = ' ' . join(
',',
$class->tsv->{sessionCacheModule} . map {
"$_ => "
. $class->tsv->{sessionCacheOptions}->{$_}
} keys %{ $class->tsv->{sessionCacheOptions} // {} }
);
}
$class->tsv->{statusPipe}->print("RELOADCACHE $params\n");
}
}
/home/maudoux/lemonldap-ng/lemonldap-ng-handler/blib/lib/Lemonldap/NG/Handler/Lib/Status.pm
elsif (/^RELOADCACHE(?:\s+(\S+?),(.+))?$/) {
if ( my ( $cacheModule, $cacheOptions ) = ( $1, $2 ) ) {
print STDERR "$cacheModule, $cacheOptions\n";
eval "use $cacheModule;"
. "\$cache = new $cacheModule($cacheOptions);";
print STDERR "$@\n" if ($@); # TODO: use logger instead
}
else {
$cache = undef;
}
}