Bugzilla – Attachment 26786 Details for
Bug 9967
Authorized values are not Plack-compatible
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 9967 - expire cached GetAuthorisedValues
Bug-9967---expire-cached-GetAuthorisedValues.patch (text/plain), 1.54 KB, created by
Robin Sheat
on 2014-04-03 05:33:09 UTC
(
hide
)
Description:
Bug 9967 - expire cached GetAuthorisedValues
Filename:
MIME Type:
Creator:
Robin Sheat
Created:
2014-04-03 05:33:09 UTC
Size:
1.54 KB
patch
obsolete
>From 1831ea069327ca23fd14375beb1278d7d8be7eb1 Mon Sep 17 00:00:00 2001 >From: Robin Sheat <robin@catalyst.net.nz> >Date: Thu, 3 Apr 2014 18:27:12 +1300 >Subject: [PATCH] Bug 9967 - expire cached GetAuthorisedValues > >Adds Memoize::Expire to the caching for GetAuthorisedValues so that >updates actually show up in a persistent environment (e.g. Plack) > >NOTE: This is an experimental patch only. It doesn't work in my testing >for no reason I can see. It's for review in case someone can see what >silly mistake I made. >--- > C4/Koha.pm | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > >diff --git a/C4/Koha.pm b/C4/Koha.pm >index 4202957..2db8c5b 100644 >--- a/C4/Koha.pm >+++ b/C4/Koha.pm >@@ -27,6 +27,7 @@ use C4::Context; > use C4::Branch qw(GetBranchesCount); > use Koha::DateUtils qw(dt_from_string); > use Memoize; >+use Memoize::Expire; > use DateTime::Format::MySQL; > use autouse 'Data::Dumper' => qw(Dumper); > use DBI qw(:sql_types); >@@ -78,7 +79,9 @@ BEGIN { > } > > # expensive functions >-memoize('GetAuthorisedValues'); >+tie my %memoize_cache => 'Memoize::Expire', >+ LIFETIME => 10; >+memoize('GetAuthorisedValues', SCALAR_HASH => [HASH => \%memoize_cache]); > > =head1 NAME > >@@ -1254,6 +1257,9 @@ Create a new authorised value. > sub AddAuthorisedValue { > my ($category, $authorised_value, $lib, $lib_opac, $imageurl) = @_; > >+ # clear the memoize cache >+ flush_cache('AddAuthorisedValue'); >+ > my $dbh = C4::Context->dbh; > my $query = qq{ > INSERT INTO authorised_values (category, authorised_value, lib, lib_opac, imageurl) >-- >1.8.3.2
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 9967
:
26786
|
26910
|
27383
|
28412
|
28625
|
31726
|
32086
|
32087