[open-ils-commits] [GIT] Evergreen ILS branch rel_2_0 updated. 67f6757e91abf632e2185b2d3d89a1b002f5fcf4
Evergreen Git
git at git.evergreen-ils.org
Tue Oct 18 12:08:57 EDT 2011
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".
The branch, rel_2_0 has been updated
via 67f6757e91abf632e2185b2d3d89a1b002f5fcf4 (commit)
from 37fec6eb8cd4bedba2471c05c0496b9c67ae3e21 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 67f6757e91abf632e2185b2d3d89a1b002f5fcf4
Author: Dan Scott <dscott at laurentian.ca>
Date: Sun Oct 16 18:39:00 2011 -0400
Cache open-ils.fielder results by locale
The problem was particularly visible in search facets, but existed
before: the cache key used for fielder results did not take locale into
account, so on a multi-locale system the first locale won and populated
the cache for all other locales.
Use a session locale if provided, otherwise default to the locale set in
opensrf.xml
Signed-off-by: Dan Scott <dscott at laurentian.ca>
Signed-off-by: Thomas Berezansky <tsbere at mvlc.org>
diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Fielder.pm b/Open-ILS/src/perlmods/OpenILS/Application/Fielder.pm
index 38a56c5..341b569 100644
--- a/Open-ILS/src/perlmods/OpenILS/Application/Fielder.pm
+++ b/Open-ILS/src/perlmods/OpenILS/Application/Fielder.pm
@@ -36,6 +36,7 @@ my $log = 'OpenSRF::Utils::Logger';
my $cache;
my $cache_timeout;
+my $default_locale;
my $parser = XML::LibXML->new();
my $xslt = XML::LibXSLT->new();
@@ -56,6 +57,8 @@ sub initialize {
$cache_timeout = $conf->config_value(
"apps", "open-ils.fielder", "app_settings", "cache_timeout" ) || 300;
+ $default_locale = $conf->config_value("default", "default_locale") || 'en-US';
+
generate_methods();
}
@@ -68,6 +71,7 @@ sub fielder_fetch {
my $client = shift;
my $obj = shift;
+ my $locale = $self->session->session_locale || $default_locale;
my $query = $obj->{query};
my $nocache = $obj->{cache} ? 0 : 1;
my $fields = $obj->{fields};
@@ -98,7 +102,8 @@ sub fielder_fetch {
$qstring .
$fstring .
$distinct .
- $obj_class
+ $obj_class .
+ $locale
);
$res = $cache->get_cache( $key );
-----------------------------------------------------------------------
Summary of changes:
.../src/perlmods/OpenILS/Application/Fielder.pm | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
hooks/post-receive
--
Evergreen ILS
More information about the open-ils-commits
mailing list