]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1360675 - Bugzilla->clear_request_cache: add option to preserve some keys in...
authorDylan William Hardison <dylan@hardison.net>
Fri, 28 Apr 2017 19:58:27 +0000 (15:58 -0400)
committerDylan William Hardison <dylan@hardison.net>
Fri, 28 Apr 2017 21:10:58 +0000 (17:10 -0400)
Bugzilla.pm

index 1f8d9d800cb4e77fb1d87e95cb1cf06df0087b44..d84815ff03d9bb4d92ea178720bd588ded88d160 100644 (file)
@@ -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