From: Dylan William Hardison Date: Fri, 28 Apr 2017 19:58:27 +0000 (-0400) Subject: Bug 1360675 - Bugzilla->clear_request_cache: add option to preserve some keys in... X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=20938c2a5dcac6a0851b8f81560790ad227ac29d;p=thirdparty%2Fbugzilla.git Bug 1360675 - Bugzilla->clear_request_cache: add option to preserve some keys in the request cache --- 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