Bugzilla – Attachment 103008 Details for
Bug 20116
Improve performance by caching the language list
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20116: Flush the caches
Bug-20116-Flush-the-caches.patch (text/plain), 2.59 KB, created by
Marcel de Rooy
on 2020-04-15 14:00:52 UTC
(
hide
)
Description:
Bug 20116: Flush the caches
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2020-04-15 14:00:52 UTC
Size:
2.59 KB
patch
obsolete
>From 0178bc15d2bbb0429d187ee768d5d6ed1f14f4e8 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 16 May 2018 17:26:09 -0300 >Subject: [PATCH] Bug 20116: Flush the caches >Content-Type: text/plain; charset=utf-8 > >When languages are added or removed when need to flush the caches to >keep the interface consistent > >Signed-off-by: Liz Rea <wizzyrea@gmail.com> >Signed-off-by: Bouzid Fergani <bouzid.fergani@inlibro.com> > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > debian/scripts/koha-translate | 17 +++++++++++++++-- > misc/bin/clear_cache.pl | 9 +++++++++ > misc/translator/translate | 4 ++++ > 3 files changed, 28 insertions(+), 2 deletions(-) > create mode 100755 misc/bin/clear_cache.pl > >diff --git a/debian/scripts/koha-translate b/debian/scripts/koha-translate >index c7bd82c212..8b9c6b664f 100755 >--- a/debian/scripts/koha-translate >+++ b/debian/scripts/koha-translate >@@ -231,6 +231,15 @@ init_template_paths() > PO_DIR="$TRANSLATE_DIR/po" > } > >+flush_cache() >+{ >+ if [ "$dev" = "" ]; then >+ koha-foreach --enabled "$KOHA_HOME/misc/bin/clear_cache.pl" >+ else >+ koha-shell $dev -c "$KOHA_HOME/misc/bin/clear_cache.pl" >+ fi >+} >+ > # Control variables > list_all="" > op="" >@@ -298,11 +307,15 @@ case $op in > "list") > list $list_all ;; > "install") >- install_lang $language ;; >+ install_lang $language >+ flush_cache >+ ;; > "update") > update_lang $language ;; > "remove") >- remove_lang $language ;; >+ remove_lang $language >+ flush_cache >+ ;; > "check") > check_lang_po_files $language ;; > *) >diff --git a/misc/bin/clear_cache.pl b/misc/bin/clear_cache.pl >new file mode 100755 >index 0000000000..3643d3273c >--- /dev/null >+++ b/misc/bin/clear_cache.pl >@@ -0,0 +1,9 @@ >+#!/usr/bin/perl -w >+ >+use Modern::Perl; >+use Koha::Caches; >+ >+# Could take parameters to be less rude >+Koha::Caches->get_instance()->flush_all; >+Koha::Caches->get_instance('config')->flush_all; >+Koha::Caches->get_instance('sysprefs')->flush_all; >diff --git a/misc/translator/translate b/misc/translator/translate >index bab716de43..f53dd464ff 100755 >--- a/misc/translator/translate >+++ b/misc/translator/translate >@@ -29,6 +29,8 @@ use LangInstaller; > use Getopt::Long; > use Pod::Usage; > >+use Koha::Caches; >+ > > my $verbose = 0; > my $pref = 0; >@@ -68,6 +70,8 @@ if ( $cmd =~ /^(create|install|update|compress|uncompress)$/ ) { > else { > $installer->$cmd(\@files); > } >+ >+ Koha::Caches->get_instance()->flush_all if $cmd ne 'update'; > } > else { > usage(); >-- >2.11.0
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 20116
:
71097
|
71098
|
73521
|
73619
|
73620
|
75382
|
75383
|
75384
|
75385
|
88200
|
88201
|
88202
|
94995
|
94996
|
94997
|
99431
|
99432
|
99433
|
103007
| 103008 |
103009
|
105359