From: erickson Date: Tue, 5 Aug 2008 17:55:36 +0000 (+0000) Subject: the existing if/else construct was forcing the proximity call regardless of whether... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=c7fe6d7234c312e2ce5ce9c273eb5302e4016eda;p=Evergreen.git the existing if/else construct was forcing the proximity call regardless of whether the cached value existed. changed and tested git-svn-id: svn://svn.open-ils.org/ILS/trunk@10263 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm b/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm index f02962c495..7456a86368 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm @@ -1165,10 +1165,10 @@ sub _check_metarecord_hold_is_possible { 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; @@ -1183,10 +1183,11 @@ sub _check_metarecord_hold_is_possible { # 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; @@ -1297,10 +1298,12 @@ sub _check_title_hold_is_possible { 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}); + $logger->info("prox cache $home_org " . $prox_cache{$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; @@ -1315,10 +1318,11 @@ sub _check_title_hold_is_possible { # 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;