[Opensrf-commits] r1156 - trunk/src/perlmods/OpenSRF

svn at svn.open-ils.org svn at svn.open-ils.org
Wed Dec 5 10:04:32 EST 2007


Author: erickson
Date: 2007-12-05 09:44:54 -0500 (Wed, 05 Dec 2007)
New Revision: 1156

Modified:
   trunk/src/perlmods/OpenSRF/Transport.pm
Log:

Added support for "migratable" opensrf services.  

See http://list.georgialibraries.org/pipermail/open-ils-dev/2007-October/001904.html



Modified: trunk/src/perlmods/OpenSRF/Transport.pm
===================================================================
--- trunk/src/perlmods/OpenSRF/Transport.pm	2007-12-05 14:38:16 UTC (rev 1155)
+++ trunk/src/perlmods/OpenSRF/Transport.pm	2007-12-05 14:44:54 UTC (rev 1156)
@@ -102,11 +102,18 @@
 	my $app_session = OpenSRF::AppSession->find( $sess_id );
 	if( $app_session and $app_session->endpoint == $app_session->SERVER() and
 			$app_session->remote_id ne $remote_id ) {
-		$logger->transport( "Backend Gone or invalid sender", INTERNAL );
-		my $res = OpenSRF::DomainObject::oilsBrokenSession->new();
-		$res->status( "Backend Gone or invalid sender, Reconnect" );
-		$app_session->status( $res );
-		return 1;
+
+	    my $c = OpenSRF::Utils::SettingsClient->new();
+        if($c->config_value("apps", $app_session->service, "migratable")) {
+            $logger->debug("service is migratable, new client is $remote_id");
+        } else {
+
+		    $logger->warn("Backend Gone or invalid sender");
+		    my $res = OpenSRF::DomainObject::oilsBrokenSession->new();
+		    $res->status( "Backend Gone or invalid sender, Reconnect" );
+		    $app_session->status( $res );
+		    return 1;
+        }
 	} 
 
 	# Retrieve or build the app_session as appropriate (server_build decides which to do)



More information about the opensrf-commits mailing list