Repair purgeLocalCache + improve default cache conf (Lemonldap-499)
This commit is contained in:
parent
94ea52a4af
commit
d455e5fd6b
|
@ -79,23 +79,23 @@ dirName=/var/lib/lemonldap-ng/conf
|
||||||
# LOCAL CACHE CONFIGURATION
|
# LOCAL CACHE CONFIGURATION
|
||||||
#
|
#
|
||||||
# To increase performances, use a local cache for the configuration. You have
|
# To increase performances, use a local cache for the configuration. You have
|
||||||
# to choose a Cache::Cache module and set it's parameters (1 line). Example:
|
# to choose a Cache::Cache module and set its parameters. Example:
|
||||||
#
|
#
|
||||||
# localStorage = Cache::FileCache
|
# localStorage = Cache::FileCache
|
||||||
# localStorageOptions={ \
|
# localStorageOptions={ \
|
||||||
# 'namespace' => 'lemonldap-ng',\
|
# 'namespace' => 'lemonldap-ng-config',\
|
||||||
# 'default_expires_in' => 600, \
|
# 'default_expires_in' => 600, \
|
||||||
# 'directory_umask' => '007', \
|
# 'directory_umask' => '007', \
|
||||||
# 'cache_root' => '/tmp', \
|
# 'cache_root' => '/tmp', \
|
||||||
# 'cache_depth' => 5, \
|
# 'cache_depth' => 0, \
|
||||||
# }
|
# }
|
||||||
localStorage=Cache::FileCache
|
localStorage=Cache::FileCache
|
||||||
localStorageOptions={ \
|
localStorageOptions={ \
|
||||||
'namespace' => 'lemonldap-ng',\
|
'namespace' => 'lemonldap-ng-config',\
|
||||||
'default_expires_in' => 600, \
|
'default_expires_in' => 600, \
|
||||||
'directory_umask' => '007', \
|
'directory_umask' => '007', \
|
||||||
'cache_root' => '/tmp', \
|
'cache_root' => '/tmp', \
|
||||||
'cache_depth' => 5, \
|
'cache_depth' => 0, \
|
||||||
}
|
}
|
||||||
|
|
||||||
[portal]
|
[portal]
|
||||||
|
@ -209,6 +209,28 @@ localStorageOptions={ \
|
||||||
|
|
||||||
[handler]
|
[handler]
|
||||||
|
|
||||||
|
# SESSION CACHE CONFIGURATION
|
||||||
|
#
|
||||||
|
# To increase performances, use a local cache for sessions. You have
|
||||||
|
# to choose a Cache::Cache module and set its parameters. Example:
|
||||||
|
#
|
||||||
|
# localStorage = Cache::FileCache
|
||||||
|
# localStorageOptions={ \
|
||||||
|
# 'namespace' => 'lemonldap-ng-sessions',\
|
||||||
|
# 'default_expires_in' => 600, \
|
||||||
|
# 'directory_umask' => '007', \
|
||||||
|
# 'cache_root' => '/tmp', \
|
||||||
|
# 'cache_depth' => 3, \
|
||||||
|
# }
|
||||||
|
localStorage=Cache::FileCache
|
||||||
|
localStorageOptions={ \
|
||||||
|
'namespace' => 'lemonldap-ng-sessions',\
|
||||||
|
'default_expires_in' => 600, \
|
||||||
|
'directory_umask' => '007', \
|
||||||
|
'cache_root' => '/tmp', \
|
||||||
|
'cache_depth' => 3, \
|
||||||
|
}
|
||||||
|
|
||||||
# Set https to 1 if your handler protect a https website (used only for
|
# Set https to 1 if your handler protect a https website (used only for
|
||||||
# redirections to the portal)
|
# redirections to the portal)
|
||||||
;https = 0
|
;https = 0
|
||||||
|
|
|
@ -19,20 +19,15 @@ my $debug = 0;
|
||||||
#=============================================================================
|
#=============================================================================
|
||||||
my $lmconf = Lemonldap::NG::Common::Conf->new()
|
my $lmconf = Lemonldap::NG::Common::Conf->new()
|
||||||
or die $Lemonldap::NG::Common::Conf::msg;
|
or die $Lemonldap::NG::Common::Conf::msg;
|
||||||
my $conf = $lmconf->getConf or die "Unable to get configuration ($!)";
|
my $conf = $lmconf->getLocalConf(HANDLERSECTION)
|
||||||
my $localconf = $lmconf->getLocalConf(HANDLERSECTION)
|
|
||||||
or die "Unable to get local configuration ($!)";
|
or die "Unable to get local configuration ($!)";
|
||||||
|
|
||||||
if ($localconf) {
|
|
||||||
$conf->{$_} = $localconf->{$_} foreach ( keys %$localconf );
|
|
||||||
}
|
|
||||||
|
|
||||||
print "Configuration loaded\n" if $debug;
|
print "Configuration loaded\n" if $debug;
|
||||||
exit 0 unless ( $conf->{localStorage} );
|
exit 0 unless ( $conf->{localStorage} );
|
||||||
eval "require $conf->{localStorage}";
|
eval "require $conf->{localStorage}";
|
||||||
$conf->{localStorageOptions}->{namespace} ||= "lemonldap";
|
$conf->{localStorageOptions}->{namespace} ||= "lemonldap";
|
||||||
$conf->{localStorageOptions}->{default_expires_in} ||= 600;
|
$conf->{localStorageOptions}->{default_expires_in} ||= 600;
|
||||||
my $c = $conf->{localStorage}->new( $conf->{localStorageOptions} );
|
my $c = $conf->{localStorage}->new( $conf->{localStorageOptions} );
|
||||||
$c->Purge();
|
$c->purge();
|
||||||
|
|
||||||
exit 0;
|
exit 0;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user