From: miker Date: Thu, 25 Oct 2007 16:10:54 +0000 (+0000) Subject: backporting think-o fix for hold stalling X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=985ac83b0e83f45c5b39cf95aee51c71fd34b9bf;p=Evergreen.git backporting think-o fix for hold stalling git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_1_2@7930 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm b/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm index 06f2b1505b..cd69b4b0bd 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm @@ -204,20 +204,18 @@ __PACKAGE__->register_method( sub nearest_hold { my $self = shift; my $client = shift; - my $pl = shift; + my $here = shift; my $cp = shift; my $limit = int(shift()) || 10; - my $age = shift() || '0'; - my $prox = shift() || 0; + my $age = shift() || '0 seconds'; - my $ids = action::hold_request->db_Main->selectcol_arrayref(<<" SQL", {}, $cp, $pl, $age, $prox); + my $ids = action::hold_request->db_Main->selectcol_arrayref(<<" SQL", {}, $here, $cp, $age); SELECT h.id FROM action.hold_request h + JOIN actor.org_unit_proximity p ON (p.from_org = ? AND p.to_org = h.pickup_lib) JOIN action.hold_copy_map hm ON (hm.hold = h.id) - JOIN actor.org_unit_proximity p ON (p.from_org = h.pickup_lib) WHERE hm.target_copy = ? - AND p.to_org = ? - AND (h.request_time + ? < NOW() OR p.prox <= ?) + AND (AGE(NOW(),h.request_time) >= CAST(? AS INTERVAL) OR p.prox = 0) AND h.capture_time IS NULL AND h.cancel_time IS NULL ORDER BY