Bugzilla – Attachment 135917 Details for
Bug 29623
Cache effective circulation rules
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29623: Don't flush the whole L1 cache
Bug-29623-Dont-flush-the-whole-L1-cache.patch (text/plain), 1.76 KB, created by
Martin Renvoize (ashimema)
on 2022-06-10 07:22:24 UTC
(
hide
)
Description:
Bug 29623: Don't flush the whole L1 cache
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2022-06-10 07:22:24 UTC
Size:
1.76 KB
patch
obsolete
>From 98248e11c654a085c2b45dadab0969f032278666 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 31 May 2022 07:36:57 +0200 >Subject: [PATCH] Bug 29623: Don't flush the whole L1 cache > >We shouldn't flush L1 cache completely, only the values related to the >circulation rules. >It is not correct to update the value of the value we are currently >setting (because of the inheritance concept of the circ rules). > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > Koha/Cache/Memory/Lite.pm | 5 +++++ > Koha/CirculationRules.pm | 8 +++----- > 2 files changed, 8 insertions(+), 5 deletions(-) > >diff --git a/Koha/Cache/Memory/Lite.pm b/Koha/Cache/Memory/Lite.pm >index 74e4115e68..21c6b121d7 100644 >--- a/Koha/Cache/Memory/Lite.pm >+++ b/Koha/Cache/Memory/Lite.pm >@@ -64,6 +64,11 @@ sub clear_from_cache { > delete $L1_cache{$key}; > } > >+sub all_keys { >+ my ( $self ) = @_; >+ return keys %L1_cache; >+} >+ > sub flush { > my ( $self ) = @_; > %L1_cache = (); >diff --git a/Koha/CirculationRules.pm b/Koha/CirculationRules.pm >index b781138fb3..2ddaa00f6b 100644 >--- a/Koha/CirculationRules.pm >+++ b/Koha/CirculationRules.pm >@@ -377,10 +377,9 @@ sub set_rule { > } > > my $memory_cache = Koha::Cache::Memory::Lite->get_instance; >- my $cache_key = sprintf "CircRules:%s:%s:%s:%s", $rule_name // q{}, >- $categorycode // q{}, $branchcode // q{}, $itemtype // q{}; >- >- Koha::Cache::Memory::Lite->flush(); >+ for my $k ( $memory_cache->all_keys ) { >+ $memory_cache->clear_from_cache($k) if $k =~ m{^CircRules:}; >+ } > > return $rule; > } >@@ -410,7 +409,6 @@ sub set_rules { > push( @$rule_objects, $rule_object ); > } > >- Koha::Cache::Memory::Lite->flush(); > return $rule_objects; > } > >-- >2.20.1
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 29623
:
128180
|
128576
|
134209
|
135463
|
135916
| 135917 |
135918
|
135919