correcting thinko that caused calling a cstore method before cstore is started
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 24 Sep 2009 19:00:06 +0000 (19:00 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 24 Sep 2009 19:00:06 +0000 (19:00 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@14155 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/Search/Z3950.pm

index 79a937c..27362a9 100755 (executable)
@@ -94,7 +94,6 @@ sub query_services {
 # -------------------------------------------------------------------
 sub fetch_service_defs {
 
-    $sclient = OpenSRF::Utils::SettingsClient->new();
     my $hash = $sclient->config_value('z3950', 'services');
 
     # overlay config file values with in-db values
@@ -159,7 +158,7 @@ sub fetch_service_defs {
 # Load the pre-defined Z server configs
 # -------------------------------------------------------------------
 sub child_init {
-    fetch_service_defs();
+    $sclient = OpenSRF::Utils::SettingsClient->new();
     $default_service = $sclient->config_value("z3950", "default" );
 }
 
@@ -169,6 +168,8 @@ sub child_init {
 # -------------------------------------------------------------------
 sub do_class_search {
 
+       fetch_service_defs() unless (scalar(keys(%services)));
+
        my $self                        = shift;
        my $conn                        = shift;
        my $auth                        = shift;
@@ -249,6 +250,8 @@ sub do_class_search {
 # -------------------------------------------------------------------
 sub do_service_search {
 
+       fetch_service_defs() unless (scalar(keys(%services)));
+
        my $self                        = shift;
        my $conn                        = shift;
        my $auth                        = shift;
@@ -272,6 +275,8 @@ sub do_service_search {
 # -------------------------------------------------------------------
 sub do_search {
 
+       fetch_service_defs() unless (scalar(keys(%services)));
+
        my $self        = shift;
        my $conn        = shift;
        my $auth = shift;
@@ -344,6 +349,9 @@ sub do_search {
 # and mvr objects
 # -------------------------------------------------------------------
 sub process_results {
+
+       fetch_service_defs() unless (scalar(keys(%services)));
+
        my $results     = shift;
        my $limit       = shift || 10;
        my $offset      = shift || 0;
@@ -420,6 +428,8 @@ sub process_results {
 # -------------------------------------------------------------------
 sub compile_query {
 
+       fetch_service_defs() unless (scalar(keys(%services)));
+
        my $seperator   = shift;
        my $service             = shift;
        my $hash                        = shift;