Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
438d57d6
Commit
438d57d6
authored
Feb 29, 2016
by
Dylan Hardison
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 1251208 - Bugzilla->request_cache() can be faster
r=dkl,a=dylan
parent
9343e3ad
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
28 deletions
+6
-28
Bugzilla.pm
Bugzilla.pm
+6
-28
No files found.
Bugzilla.pm
View file @
438d57d6
...
@@ -684,43 +684,21 @@ sub local_timezone {
...
@@ -684,43 +684,21 @@ sub local_timezone {
||=
DateTime::
TimeZone
->
new
(
name
=>
'local'
);
||=
DateTime::
TimeZone
->
new
(
name
=>
'local'
);
}
}
# This creates the request cache for non-mod_perl installations.
my
$request_cache
=
{};
# This is identical to Install::Util::_cache so that things loaded
# into Install::Util::_cache during installation can be read out
sub
request_cache
{
return
$request_cache
}
# 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
;
}
sub
clear_request_cache
{
sub
clear_request_cache
{
$_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
)};
}
}
}
}
# This is a per-process cache. Under mod_cgi it's identical to the
# This is a per-process cache. Under mod_cgi it's identical to the
# request_cache. When using mod_perl, items in this cache live until the
# request_cache. When using mod_perl, items in this cache live until the
# worker process is terminated.
# worker process is terminated.
our
$_
process_cache
=
{};
my
$
process_cache
=
{};
sub
process_cache
{
sub
process_cache
{
return
$
_
process_cache
;
return
$process_cache
;
}
}
# This is a memcached wrapper, which provides cross-process and cross-system
# This is a memcached wrapper, which provides cross-process and cross-system
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment