From 1007379704357f48595dfe0b6ac8ea1341056056 Mon Sep 17 00:00:00 2001 From: miker Date: Wed, 21 May 2008 16:37:30 +0000 Subject: [PATCH] allow differentiation of orgtree cache keys; use this to cache per-locale trees git-svn-id: svn://svn.open-ils.org/ILS/trunk@9654 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/perlmods/OpenILS/Application/Actor.pm | 5 +++-- Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm b/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm index a38ad7e005..768d7e5aad 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm @@ -1035,8 +1035,9 @@ __PACKAGE__->register_method( ); sub get_org_tree { - my( $self, $client) = @_; - return $U->get_org_tree(); + my $self = shift; + my $client = shift; + return $U->get_org_tree($client->session->session_locale); } diff --git a/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm b/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm index 1404008b0a..91237b4114 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm @@ -1368,8 +1368,9 @@ sub get_org_types { } sub get_org_tree { + my $cache_diff = shift || ''; my $cache = OpenSRF::Utils::Cache->new("global", 0); - my $tree = $cache->get_cache('orgtree'); + my $tree = $cache->get_cache("orgtree.$cache_diff"); return $tree if $tree; $tree = OpenILS::Utils::CStoreEditor->new->search_actor_org_unit( @@ -1383,7 +1384,7 @@ sub get_org_tree { ] )->[0]; - $cache->put_cache('orgtree', $tree); + $cache->put_cache("orgtree.$cache_diff", $tree); return $tree; } -- 2.43.2