[open-ils-commits] r9654 - trunk/Open-ILS/src/perlmods/OpenILS/Application

svn at svn.open-ils.org svn at svn.open-ils.org
Wed May 21 12:37:35 EDT 2008


Author: miker
Date: 2008-05-21 12:37:30 -0400 (Wed, 21 May 2008)
New Revision: 9654

Modified:
   trunk/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm
   trunk/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm
Log:
allow differentiation of orgtree cache keys; use this to cache per-locale trees

Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm	2008-05-21 14:44:04 UTC (rev 9653)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm	2008-05-21 16:37:30 UTC (rev 9654)
@@ -1035,8 +1035,9 @@
 );
 
 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);
 }
 
 

Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm	2008-05-21 14:44:04 UTC (rev 9653)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm	2008-05-21 16:37:30 UTC (rev 9654)
@@ -1368,8 +1368,9 @@
 }
 
 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 @@
 		]
 	)->[0];
 
-	$cache->put_cache('orgtree', $tree);
+	$cache->put_cache("orgtree.$cache_diff", $tree);
 	return $tree;
 }
 



More information about the open-ils-commits mailing list