From 125df28d4bd061528acdbaa70a224d4c1f7f2994 Mon Sep 17 00:00:00 2001 From: Olli-Antti Kivilahti Date: Mon, 9 Jan 2017 18:10:03 +0200 Subject: [PATCH] Bug 18232 - Koha::Cache::flush - Simply flush all caches So we can easily and without reading the code, figure out how to flush all caches. perl -e 'use Koha::Caches; Koha::Caches::flush();' This is handy dandy when upgrading Koha or fiddling with configs. --- Koha/Caches.pm | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Koha/Caches.pm b/Koha/Caches.pm index 8940925..cb3081f 100644 --- a/Koha/Caches.pm +++ b/Koha/Caches.pm @@ -64,4 +64,21 @@ sub flush_L1_caches { } } +=head2 + + Koha::Caches::flush(); + +Flushes all known L1 and L2 caches + +=cut + +sub flush { + return unless $singleton_caches; + for my $k ( keys %$singleton_caches ) { + my $cache = $singleton_caches->{$k}; + $cache->flush_all(); + delete $singleton_caches->{$k}; + } +} + 1; -- 2.7.4