From 8e98f21537c5a1884250c6b1c7d1d7500001704f Mon Sep 17 00:00:00 2001 From: Julian Maurice Date: Fri, 28 Aug 2020 17:39:00 +0400 Subject: [PATCH] Bug 20582: Fix a cache issue in Koha::App::{Opac,Intranet} This was a workaround I wrote when Koha::Caches->flush_L1_caches was not flushing all caches correctly. Now it's not needed and it causes problems, so it must be removed. --- Koha/App/Intranet.pm | 12 +----------- Koha/App/Opac.pm | 12 +----------- 2 files changed, 2 insertions(+), 22 deletions(-) diff --git a/Koha/App/Intranet.pm b/Koha/App/Intranet.pm index 3eddd49fab..d06c65260d 100644 --- a/Koha/App/Intranet.pm +++ b/Koha/App/Intranet.pm @@ -66,17 +66,7 @@ sub _around_action { my ($next, $c, $action, $last) = @_; # Flush memory caches before every request - my $caches = $Koha::Caches::singleton_caches; - if ($caches) { - foreach my $key (keys %$caches) { - my $cache = $caches->{$key}; - if (ref $cache->{cache} eq 'Cache::Memory') { - $cache->flush_all; - } - $cache->flush_L1_cache; - } - } - $Koha::Caches::singleton_caches = {}; + Koha::Caches->flush_L1_caches(); Koha::Cache::Memory::Lite->flush(); return $next->(); diff --git a/Koha/App/Opac.pm b/Koha/App/Opac.pm index 47da075b82..89ff94c5ec 100644 --- a/Koha/App/Opac.pm +++ b/Koha/App/Opac.pm @@ -66,17 +66,7 @@ sub _around_action { my ($next, $c, $action, $last) = @_; # Flush memory caches before every request - my $caches = $Koha::Caches::singleton_caches; - if ($caches) { - foreach my $key (keys %$caches) { - my $cache = $caches->{$key}; - if (ref $cache->{cache} eq 'Cache::Memory') { - $cache->flush_all; - } - $cache->flush_L1_cache; - } - } - $Koha::Caches::singleton_caches = {}; + Koha::Caches->flush_L1_caches(); Koha::Cache::Memory::Lite->flush(); return $next->(); -- 2.20.1