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 <mrylander@gmail.com>
Signed-off-by: Dan Wells <dbw2@calvin.edu>
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;
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)
};