Move setting of OpenSRF::Application::shared_conf to load_bootstrap_config.
authorJason Stephenson <jstephenson@mvlc.org>
Thu, 15 Nov 2012 17:20:11 +0000 (12:20 -0500)
committerDan Scott <dscott@laurentian.ca>
Sun, 18 Nov 2012 12:27:40 +0000 (07:27 -0500)
shared_conf was not available and broke clients that were not in a
service, such as the Evergreen CStoreEditor.

Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
Signed-off-by: Dan Scott <dscott@laurentian.ca>

src/perl/lib/OpenSRF/System.pm

index 62a17a8..e26579b 100644 (file)
@@ -35,6 +35,14 @@ sub load_bootstrap_config {
        OpenSRF::Transport->message_envelope("OpenSRF::Transport::SlimJabber::MessageWrapper");
        OpenSRF::Transport::PeerHandle->set_peer_client("OpenSRF::Transport::SlimJabber::PeerConnection");
        OpenSRF::Application->server_class('client');
+    # Read in a shared portion of the config file
+    # for later use in log parameter redaction
+    $OpenSRF::Application::shared_conf = OpenSRF::Utils::Config->load(
+        'config_file' => OpenSRF::Utils::Config->current->FILE,
+        'nocache' => 1,
+        'force' => 1,
+        'base_path' => '/config/shared'
+    );
 }
 
 # ----------------------------------------------
@@ -84,15 +92,6 @@ sub run_service {
     OpenSRF::Application->application_implementation->initialize()
         if (OpenSRF::Application->application_implementation->can('initialize'));
 
-    # Read in a shared portion of the config file
-    # for later use in log parameter redaction
-    $OpenSRF::Application::shared_conf = OpenSRF::Utils::Config->load(
-        'config_file' => OpenSRF::Utils::Config->current->FILE,
-        'nocache' => 1,
-        'force' => 1,
-        'base_path' => '/config/shared'
-    );
-
     # kill the temp connection
     OpenSRF::Transport::PeerHandle->retrieve->disconnect;