From 5dad7697ffa3dbff3e0615ced0da839601ddfc8a Mon Sep 17 00:00:00 2001 From: dgw Date: Sun, 25 Oct 2015 03:02:35 -0400 Subject: [PATCH] Refill large var caches below var_limit values Fall back on hard-coded value of 3 in case var_limit is set to 0 (no limit). Better fixes #61 --- bucket.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bucket.pl b/bucket.pl index 43288a7..8d30d38 100755 --- a/bucket.pl +++ b/bucket.pl @@ -3234,7 +3234,8 @@ sub expand { $replacement = &set_case( $var, $replacement ); $replacement = A($replacement) if $2; - if ( exists $record->{cache} and 3 > @{$record->{cache}} ) { + if ( exists $record->{cache} and + @{$record->{cache}} < (&config("var_limit") or 3) ) { Log "Refilling cache for $var"; &sql( 'select vars.id id, name, perms, type, value