summaryrefslogtreecommitdiffstats
path: root/Bugzilla.pm
diff options
context:
space:
mode:
authorDylan William Hardison <dylan@hardison.net>2016-11-23 17:41:44 +0100
committerDylan William Hardison <dylan@hardison.net>2016-12-01 16:18:58 +0100
commit1e762fa5d00732bfdfb51fd8b3e56879f17d8f6e (patch)
treec424a293d0e1df8c41c977f48e8bd94d05a0fb86 /Bugzilla.pm
parent78eac2241f5b7e701b2c7b62a0ec0b8272495cca (diff)
downloadbugzilla-1e762fa5d00732bfdfb51fd8b3e56879f17d8f6e.tar.gz
bugzilla-1e762fa5d00732bfdfb51fd8b3e56879f17d8f6e.tar.xz
Bug 1319503 - Backport request_cache optimizations from upstream
Diffstat (limited to 'Bugzilla.pm')
-rw-r--r--Bugzilla.pm24
1 files changed, 2 insertions, 22 deletions
diff --git a/Bugzilla.pm b/Bugzilla.pm
index 72192d41a..f563ba9e3 100644
--- a/Bugzilla.pm
+++ b/Bugzilla.pm
@@ -731,30 +731,10 @@ sub audit {
# This is identical to Install::Util::_cache so that things loaded
# into Install::Util::_cache during installation can be read out
# of request_cache later in installation.
-our $_request_cache = $Bugzilla::Install::Util::_cache;
-
-sub request_cache {
- if ($ENV{MOD_PERL}) {
- require Apache2::RequestUtil;
- # Sometimes (for example, during mod_perl.pl), the request
- # object isn't available, and we should use $_request_cache instead.
- my $request = eval { Apache2::RequestUtil->request };
- return $_request_cache if !$request;
- return $request->pnotes();
- }
- return $_request_cache;
-}
+use constant request_cache => Bugzilla::Install::Util::_cache();
sub clear_request_cache {
- $_request_cache = {};
- if ($ENV{MOD_PERL}) {
- require Apache2::RequestUtil;
- my $request = eval { Apache2::RequestUtil->request };
- if ($request) {
- my $pnotes = $request->pnotes;
- delete @$pnotes{(keys %$pnotes)};
- }
- }
+ %{ request_cache() } = ();
}
# This is a per-process cache. Under mod_cgi it's identical to the