From 20938c2a5dcac6a0851b8f81560790ad227ac29d Mon Sep 17 00:00:00 2001 From: Dylan William Hardison Date: Fri, 28 Apr 2017 15:58:27 -0400 Subject: Bug 1360675 - Bugzilla->clear_request_cache: add option to preserve some keys in the request cache --- Bugzilla.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'Bugzilla.pm') diff --git a/Bugzilla.pm b/Bugzilla.pm index 1f8d9d800..d84815ff0 100644 --- a/Bugzilla.pm +++ b/Bugzilla.pm @@ -710,7 +710,11 @@ sub audit { use constant request_cache => Bugzilla::Install::Util::_cache(); sub clear_request_cache { - %{ request_cache() } = (); + my ($class, %option) = @_; + my $request_cache = request_cache(); + my @except = $option{except} ? @{ $option{except} } : (); + + %{ $request_cache } = map { $_ => $request_cache->{$_} } @except; } # This is a per-process cache. Under mod_cgi it's identical to the -- cgit v1.2.3-24-g4f1b