From: Bill Erickson Date: Fri, 30 Dec 2016 16:54:08 +0000 (-0500) Subject: LP#1653001 Hold details authoritative API cstore maintenance X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=02edc5ca4b6cc1b4f7c03d2faaa18b09ac4764bf;p=evergreen%2Fpines.git LP#1653001 Hold details authoritative API cstore maintenance Avoid cstore exhaustion during .authorative API calls that run Holds:retrieve_hold_queue_status_impl() by using the in-transaction editor for YAOUS lookups instead of allowing the lookups to create their own cstore connections, each spawning a new transaction, since CStoreEditor is in authoritative mode. Since CStoreEditor authoritative handling leaves each cstore transaction open until the API call completes, and in this case, each hold in the batch lookup resulted in 2 additional open cstore connections per hold, a batch lookup of (say) 15 holds, meant 31 cstore connections were opened in one API call. Telling the YAOUS lookup to use the existing editor means the same call completes with 1 cstore connection. Signed-off-by: Bill Erickson Signed-off-by: Kathy Lussier --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm index 9f5f42c7d1..1825c71580 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm @@ -1443,8 +1443,10 @@ sub retrieve_hold_queue_status_impl { my $user_org = $e->json_query({select => {au => ['home_ou']}, from => 'au', where => {id => $hold->usr}})->[0]->{home_ou}; - my $default_wait = $U->ou_ancestor_setting_value($user_org, OILS_SETTING_HOLD_ESIMATE_WAIT_INTERVAL); - my $min_wait = $U->ou_ancestor_setting_value($user_org, 'circ.holds.min_estimated_wait_interval'); + my $default_wait = $U->ou_ancestor_setting_value( + $user_org, OILS_SETTING_HOLD_ESIMATE_WAIT_INTERVAL, $e); + my $min_wait = $U->ou_ancestor_setting_value( + $user_org, 'circ.holds.min_estimated_wait_interval', $e); $min_wait = OpenSRF::Utils::interval_to_seconds($min_wait || '0 seconds'); $default_wait ||= '0 seconds';