Set configuration checkTime (#1454)
This commit is contained in:
parent
a725a8f28f
commit
f5971ad98d
|
@ -24,6 +24,7 @@ sub defaultValues {
|
|||
'captcha_size' => 6,
|
||||
'casAccessControlPolicy' => 'none',
|
||||
'casAuthnLevel' => 1,
|
||||
'checkTime' => 600,
|
||||
'checkXSS' => 1,
|
||||
'confirmFormMethod' => 'post',
|
||||
'cookieName' => 'lemonldap',
|
||||
|
|
|
@ -19,8 +19,12 @@ sub grant {
|
|||
my ( $class, $req, $session, $uri, $cond, $vhost ) = @_;
|
||||
$vhost ||= $class->resolveAlias($req);
|
||||
$class->tsv->{lastVhostUpdate} //= {};
|
||||
unless ( $class->tsv->{defaultCondition}->{$vhost}
|
||||
and ( time() - $class->tsv->{lastVhostUpdate}->{$vhost} < 600 ) )
|
||||
unless (
|
||||
$class->tsv->{defaultCondition}->{$vhost}
|
||||
and (
|
||||
time() - $class->tsv->{lastVhostUpdate}->{$vhost} <
|
||||
$class->tsv->{checkTime} )
|
||||
)
|
||||
{
|
||||
$class->loadVhostConfig( $req, $vhost );
|
||||
}
|
||||
|
|
|
@ -36,6 +36,7 @@ sub checkConf {
|
|||
$class->logger->debug("Check configuration for $class");
|
||||
my $prm = { local => !$force, localPrm => $class->localConfig };
|
||||
my $conf = $class->confAcc->getConf($prm);
|
||||
chomp $Lemonldap::NG::Common::Conf::msg;
|
||||
|
||||
unless ( ref($conf) ) {
|
||||
$class->logger->error(
|
||||
|
@ -57,7 +58,6 @@ sub checkConf {
|
|||
}
|
||||
if ( $force or !$class->cfgNum or $class->cfgNum != $conf->{cfgNum} ) {
|
||||
$class->logger->debug("Get configuration $conf->{cfgNum}");
|
||||
$class->lastCheck( time() );
|
||||
unless ( $class->cfgNum( $conf->{cfgNum} ) ) {
|
||||
$class->logger->error('No configuration available');
|
||||
return 0;
|
||||
|
@ -76,6 +76,8 @@ sub checkConf {
|
|||
}
|
||||
}
|
||||
}
|
||||
$class->tsv->{checkTime} = $conf->{checkTime} if ( $conf->{checkTime} );
|
||||
$class->lastCheck( time() );
|
||||
$class->logger->debug("$class: configuration is up to date");
|
||||
return 1;
|
||||
}
|
||||
|
|
|
@ -759,6 +759,10 @@ qr/(?:(?:https?):\/\/(?:(?:(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.]
|
|||
'checkStateSecret' => {
|
||||
'type' => 'text'
|
||||
},
|
||||
'checkTime' => {
|
||||
'default' => 600,
|
||||
'type' => 'int'
|
||||
},
|
||||
'checkXSS' => {
|
||||
'default' => 1,
|
||||
'type' => 'bool'
|
||||
|
|
|
@ -215,6 +215,12 @@ sub attributes {
|
|||
return {
|
||||
|
||||
# Other
|
||||
checkTime => {
|
||||
type => 'int',
|
||||
documentation =>
|
||||
'Timeout to check new configuration in local cache',
|
||||
default => 600,
|
||||
},
|
||||
configStorage => {
|
||||
type => 'text',
|
||||
documentation => 'Configuration storage',
|
||||
|
|
Loading…
Reference in New Issue
Block a user