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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ivan Ivlev
bugzilla
Commits
f7d1f7b8
Commit
f7d1f7b8
authored
Oct 05, 2012
by
Byron Jones
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 797883: Adds a Bugzilla->process_cache
r=LpSolit, a=LpSolit
parent
c204c9eb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
9 deletions
+16
-9
Bugzilla.pm
Bugzilla.pm
+10
-2
Template.pm
Bugzilla/Template.pm
+6
-7
No files found.
Bugzilla.pm
View file @
f7d1f7b8
...
...
@@ -271,8 +271,7 @@ sub input_params {
our
$_localconfig
;
sub
localconfig
{
$_localconfig
||=
read_localconfig
();
return
$_localconfig
;
return
$_
[
0
]
->
process_cache
->
{
localconfig
}
||=
read_localconfig
();
}
sub
params
{
...
...
@@ -643,6 +642,15 @@ sub request_cache {
return
$_request_cache
;
}
# 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
# worker process is terminated.
our
$_process_cache
=
{};
sub
process_cache
{
return
$_process_cache
;
}
# Private methods
# Per-process cleanup. Note that this is a plain subroutine, not a method,
...
...
Bugzilla/Template.pm
View file @
f7d1f7b8
...
...
@@ -41,10 +41,6 @@ use constant FORMAT_3_SIZE => [19,28,28];
use
constant
FORMAT_DOUBLE
=>
'%19s %-55s'
;
use
constant
FORMAT_2_SIZE
=>
[
19
,
55
];
# Use a per-process provider to cache compiled templates in memory across
# requests.
our
%
shared_providers
;
# Pseudo-constant.
sub
SAFE_URL_REGEXP
{
my
$safe_protocols
=
join
(
'|'
,
SAFE_PROTOCOLS
);
...
...
@@ -982,9 +978,12 @@ sub create {
'default_authorizer'
=>
new
Bugzilla::
Auth
(),
},
};
# Use a per-process provider to cache compiled templates in memory across
# requests.
my
$provider_key
=
join
(
':'
,
@
{
$config
->
{
INCLUDE_PATH
}
});
$shared_providers
{
$provider_key
}
||=
Template::
Provider
->
new
(
$config
);
$config
->
{
LOAD_TEMPLATES
}
=
[
$shared_providers
{
$provider_key
}
];
my
$shared_providers
=
Bugzilla
->
process_cache
->
{
shared_providers
}
||=
{};
$shared_providers
->
{
$provider_key
}
||=
Template::
Provider
->
new
(
$config
);
$config
->
{
LOAD_TEMPLATES
}
=
[
$shared_providers
->
{
$provider_key
}
];
local
$
Template::Config::
CONTEXT
=
'Bugzilla::Template::Context'
;
...
...
@@ -1051,7 +1050,7 @@ sub precompile_templates {
}
# Clear out the cached Provider object
undef
%
shared_providers
;
Bugzilla
->
process_cache
->
{
shared_providers
}
=
undef
;
}
# Under mod_perl, we look for templates using the absolute path of the
...
...
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