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
da0347e9
Commit
da0347e9
authored
Mar 21, 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 without breaking stuff this time.
parent
0cac98df
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
37 deletions
+8
-37
Bugzilla.pm
Bugzilla.pm
+6
-28
Util.pm
Bugzilla/Install/Util.pm
+2
-9
No files found.
Bugzilla.pm
View file @
da0347e9
...
@@ -682,43 +682,21 @@ sub local_timezone {
...
@@ -682,43 +682,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
=
Bugzilla::Install::Util::
_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
...
...
Bugzilla/Install/Util.pm
View file @
da0347e9
...
@@ -651,15 +651,8 @@ sub prevent_windows_dialog_boxes {
...
@@ -651,15 +651,8 @@ sub prevent_windows_dialog_boxes {
# This is like request_cache, but it's used only by installation code
# This is like request_cache, but it's used only by installation code
# for checksetup.pl and things like that.
# for checksetup.pl and things like that.
our
$_cache
=
{};
my
$_cache
=
{};
sub
_cache
{
sub
_cache
{
return
$_cache
;
}
# If the normal request_cache is available (which happens any time
# after the requirements phase) then we should use that.
if
(
eval
{
Bugzilla
->
request_cache
;
})
{
return
Bugzilla
->
request_cache
;
}
return
$_cache
;
}
###############################
###############################
# Copied from Bugzilla::Util #
# Copied from Bugzilla::Util #
...
...
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