Bugzilla – Attachment 9556 Details for
Bug 7248
Caching for services
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 7248 follow-up (3): cache the cache handler
Bug-7248-follow-up-3-cache-the-cache-handler.patch (text/plain), 1.25 KB, created by
Paul Poulain
on 2012-05-14 11:41:35 UTC
(
hide
)
Description:
Bug 7248 follow-up (3): cache the cache handler
Filename:
MIME Type:
Creator:
Paul Poulain
Created:
2012-05-14 11:41:35 UTC
Size:
1.25 KB
patch
obsolete
>From d4c35d4d1636a460e978e657b274faf5943dd444 Mon Sep 17 00:00:00 2001 >From: Paul Poulain <paul.poulain@biblibre.com> >Date: Mon, 14 May 2012 13:40:01 +0200 >Subject: [PATCH] Bug 7248 follow-up (3): cache the cache handler > >Before this patch, a cache handler was opened everytime ->new() was called. With this patch, only the 1st call to ->new() create a handler >--- > Koha/Cache.pm | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > >diff --git a/Koha/Cache.pm b/Koha/Cache.pm >index ca409b7..bf1e977 100644 >--- a/Koha/Cache.pm >+++ b/Koha/Cache.pm >@@ -49,12 +49,15 @@ use Carp; > > use base qw(Class::Accessor); > >+use vars qw($_cache_handler); >+ > use Koha::Cache::Memcached; > > __PACKAGE__->mk_ro_accessors( qw( cache ) ); > > sub new { > my $class = shift; >+ return $_cache_handler if $_cache_handler; > # my $param = shift; > my $cache; > my $subclass; >@@ -69,7 +72,8 @@ sub new { > } > ) > or croak "Cannot create cache handle for memcache"; >- return bless $class->SUPER::new({cache => $cache}), $subclass; >+ $_cache_handler = bless $class->SUPER::new({cache => $cache}), $subclass; >+ return $_cache_handler; > } else { > $ENV{DEBUG} && warn "No caching system"; > return; >-- >1.7.9.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 7248
:
6353
|
6354
|
6356
|
6359
|
6372
|
6771
|
6772
|
7342
|
7343
|
7366
|
7367
|
9348
|
9349
|
9352
|
9353
|
9360
|
9552
|
9553
|
9554
|
9555
|
9556
|
9567
|
9568
|
9569
|
9571