Have Table.pm force flush of more than 5 seconds old, in preparation for more aggresive cache retention

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@12481 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
jbjohnso 2012-05-02 19:57:49 +00:00
parent 3c38e7c850
commit abd9669f93

View File

@ -3022,6 +3022,9 @@ sub getAllAttribs
my @attribs = @_;
my @results = ();
if ($self->{_use_cache}) {
if ($self->{_cachestamp} < (time()-5)) { #NEVER use a cache older than 5 seconds
$self->_refresh_cache();
}
my @results;
my $cacheline;
CACHELINE: foreach $cacheline (@{$self->{_tablecache}}) {
@ -3248,6 +3251,9 @@ sub getAttribs
}
my @return;
if ($self->{_use_cache}) {
if ($self->{_cachestamp} < (time()-5)) { #NEVER use a cache older than 5 seconds
$self->_refresh_cache();
}
my @results;
my $cacheline;
if (scalar(keys %keypairs) == 1 and $keypairs{node}) { #99.9% of queries look like this, optimized case