Bugzilla – Attachment 39514 Details for
Bug 14207
Improving circulation performance by caching yaml file
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14207 - Improving circulation performance by caching yaml file
Bug-14207---Improving-circulation-performance-by-c.patch (text/plain), 1.60 KB, created by
Julian FIOL
on 2015-05-26 12:57:01 UTC
(
hide
)
Description:
Bug 14207 - Improving circulation performance by caching yaml file
Filename:
MIME Type:
Creator:
Julian FIOL
Created:
2015-05-26 12:57:01 UTC
Size:
1.60 KB
patch
obsolete
>From c71b772198b46bae01918550c1f5ea6704424f13 Mon Sep 17 00:00:00 2001 >From: Julian FIOL <julian.fiol@biblibre.com> >Date: Tue, 26 May 2015 14:49:20 +0200 >Subject: [PATCH] Bug 14207 - Improving circulation performance by caching yaml > file This patch improve circulation performance by caching yaml file With > this patch we saved between 300ms and 500ms on circulation page. > >Following Comment #3 : >No useless warn >No tidy >--- > C4/Utils/DataTables/ColumnsSettings.pm | 17 +++++++++++------ > 1 file changed, 11 insertions(+), 6 deletions(-) > >diff --git a/C4/Utils/DataTables/ColumnsSettings.pm b/C4/Utils/DataTables/ColumnsSettings.pm >index ed8d9ac..6f1c0cd 100644 >--- a/C4/Utils/DataTables/ColumnsSettings.pm >+++ b/C4/Utils/DataTables/ColumnsSettings.pm >@@ -5,14 +5,19 @@ use List::Util qw( first ); > use YAML; > use C4::Context; > use Koha::Database; >+use Koha::Cache; > > sub get_yaml { >- my $yml_path = >- C4::Context->config('intranetdir') . '/admin/columns_settings.yml'; >- my $yaml = eval { YAML::LoadFile($yml_path) }; >- warn >-"ERROR: the yaml file for DT::ColumnsSettings is not correctly formated: $@" >- if $@; >+ my $yml_path = C4::Context->config('intranetdir') . '/admin/columns_settings.yml'; >+ my $cache = Koha::Cache->get_instance(); >+ my $yaml = $cache->get_from_cache('ColumnsSettingsYaml'); >+ >+ unless ($yaml) { >+ $yaml = eval { YAML::LoadFile($yml_path) }; >+ warn "ERROR: the yaml file for DT::ColumnsSettings is not correctly formated: $@" >+ if $@; >+ $cache->set_in_cache( 'ColumnsSettingsYaml', $yaml, { expiry => 3600 } ); >+ } > return $yaml; > } > >-- >2.4.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 14207
:
39210
|
39211
|
39233
|
39514
|
40428
|
40457