Bugzilla – Attachment 51086 Details for
Bug 16412
Cache undef in L1 only
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16412: Cache undef in L1 only
Bug-16412-Cache-undef-in-L1-only.patch (text/plain), 1.16 KB, created by
Marcel de Rooy
on 2016-05-02 10:31:23 UTC
(
hide
)
Description:
Bug 16412: Cache undef in L1 only
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2016-05-02 10:31:23 UTC
Size:
1.16 KB
patch
obsolete
>From 2e6ebc0c18b5b44be62c0b50e2cc917faf1c49a1 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Mon, 2 May 2016 12:26:44 +0200 >Subject: [PATCH] Bug 16412: Cache undef in L1 only >Content-Type: text/plain; charset=utf-8 > >No need to cache undef in L2. >Prevent numerous warnings like: >Use of uninitialized value in subroutine entry at /usr/share/koha/masterclone/Koha/Cache.pm line 284 > >Test plan: >Run t/Cache.t >Run t/db_dependent/sysprefs.t >--- > Koha/Cache.pm | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > >diff --git a/Koha/Cache.pm b/Koha/Cache.pm >index 7793f06..741be7a 100644 >--- a/Koha/Cache.pm >+++ b/Koha/Cache.pm >@@ -271,10 +271,11 @@ sub set_in_cache { > # Deep copy if it's not a scalar and unsafe is not passed > $value = dclone( $value ) if ref($value) and not $unsafe; > >- # Set in L1 cache >+ # Set in L1 cache; exit if you are caching an undef > $L1_cache{ $key } = $value; >+ return if !defined $value; > >- # We consider an expiry of 0 to be inifinite >+ # We consider an expiry of 0 to be infinite > if ( $expiry ) { > return $set_sub > ? $set_sub->( $key, $value, $expiry ) >-- >1.7.10.4
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 16412
:
51086
|
51089
|
51090
|
51310
|
51311