From 87f99bac9fcd9b20e6f53e543c7b6c71139974b6 Mon Sep 17 00:00:00 2001 From: Mike Rylander Date: Wed, 14 Sep 2016 10:44:15 -0400 Subject: [PATCH] LP#1623541: Booking will fail if its router isn't called "router" The circ code checks to see if the booking app is running, and if not, it skips some booking-related logic. This is a useful performance enhancement where booking is not in use. It does this by asking the OpenSRF router if the "open-ils.booking" app has registered with it. Most of the time the OpenSRF router will be called, unimaginatively, "router" but when it's not, booking will not be considered by the circ module even if it's running. Instead of assuming "router" we should simply look up the router's name. Signed-off-by: Mike Rylander --- Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm index dcef1d2e4d..d142df63a3 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm @@ -5,6 +5,7 @@ use OpenSRF::EX qw(:try); use OpenSRF::AppSession; use OpenSRF::Utils::SettingsClient; use OpenSRF::Utils::Logger qw(:logger); +use OpenSRF::Utils::Config; use OpenILS::Const qw/:const/; use OpenILS::Application::AppUtils; use DateTime; @@ -17,7 +18,12 @@ my $desk_renewal_use_circ_lib; sub determine_booking_status { unless (defined $booking_status) { - my $ses = create OpenSRF::AppSession("router"); + my $router_name = OpenSRF::Utils::Config + ->current + ->bootstrap + ->router_name || 'router'; + + my $ses = create OpenSRF::AppSession($router_name); $booking_status = grep {$_ eq "open-ils.booking"} @{ $ses->request("opensrf.router.info.class.list")->gather(1) }; -- 2.11.0