[open-ils-commits] r10264 -
branches/rel_1_2/Open-ILS/src/perlmods/OpenILS/Application/Circ
svn at svn.open-ils.org
svn at svn.open-ils.org
Tue Aug 5 13:58:17 EDT 2008
Author: erickson
Date: 2008-08-05 13:58:09 -0400 (Tue, 05 Aug 2008)
New Revision: 10264
Modified:
branches/rel_1_2/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm
Log:
the existing if/else construct was forcing the proximity call regardless of whether the cached value existed. changed and tested
Modified: branches/rel_1_2/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm
===================================================================
--- branches/rel_1_2/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm 2008-08-05 17:55:36 UTC (rev 10263)
+++ branches/rel_1_2/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm 2008-08-05 17:58:09 UTC (rev 10264)
@@ -1179,11 +1179,12 @@
my $home_org = $patron->home_ou;
my $req_org = $request_lib->id;
- my $home_prox =
- ($prox_cache{$home_org}) ?
- $prox_cache{$home_org} :
- $prox_cache{$home_org} = $e->search_actor_org_unit_proximity({from_org => $home_org});
+ $prox_cache{$home_org} =
+ $e->search_actor_org_unit_proximity({from_org => $home_org})
+ unless $prox_cache{$home_org};
+ my $home_prox = $prox_cache{$home_org};
+
my %buckets;
my %hash = map { ($_->to_org => $_->prox) } @$home_prox;
push( @{$buckets{ $hash{$_->{circ_lib}} } }, $_->{id} ) for @$copies;
@@ -1197,11 +1198,12 @@
# directly before the farthest away copies. That way, they are not
# given priority, but they are checked before the farthest copies.
# -----------------------------------------------------------------------
- my $req_prox =
- ($prox_cache{$req_org}) ?
- $prox_cache{$req_org} :
- $prox_cache{$req_org} = $e->search_actor_org_unit_proximity({from_org => $req_org});
+ $prox_cache{$req_org} =
+ $e->search_actor_org_unit_proximity({from_org => $req_org})
+ unless $prox_cache{$req_org};
+ my $req_prox = $prox_cache{$req_org};
+
my %buckets2;
my %hash2 = map { ($_->to_org => $_->prox) } @$req_prox;
push( @{$buckets2{ $hash2{$_->{circ_lib}} } }, $_->{id} ) for @$copies;
More information about the open-ils-commits
mailing list