From: Mike Rylander Date: Wed, 14 Sep 2016 14:44:15 +0000 (-0400) Subject: LP#1623541: Booking will fail if its router isn't called "router" X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=34015d516b9d826fa88476782fec028d91caf9ff;p=working%2FEvergreen.git 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 Signed-off-by: Dan Wells --- 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 6ce9eb88d1..008cd7fb3f 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) };