[open-ils-commits] r16991 - trunk/Open-ILS/src/support-scripts (erickson)

svn at svn.open-ils.org svn at svn.open-ils.org
Tue Jul 20 17:16:05 EDT 2010


Author: erickson
Date: 2010-07-20 17:16:00 -0400 (Tue, 20 Jul 2010)
New Revision: 16991

Modified:
   trunk/Open-ILS/src/support-scripts/marc_stream_importer.pl
Log:
flush the xmpp socket before attempting to process new marc stream requests

Modified: trunk/Open-ILS/src/support-scripts/marc_stream_importer.pl
===================================================================
--- trunk/Open-ILS/src/support-scripts/marc_stream_importer.pl	2010-07-20 21:15:59 UTC (rev 16990)
+++ trunk/Open-ILS/src/support-scripts/marc_stream_importer.pl	2010-07-20 21:16:00 UTC (rev 16991)
@@ -31,6 +31,7 @@
 use OpenSRF::AppSession;
 use OpenSRF::EX qw/:try/;
 use OpenILS::Utils::Cronscript;
+use OpenSRF::Transport::PeerHandle;
 require 'oils_header.pl';
 use vars qw/$apputils/;
 
@@ -347,6 +348,13 @@
 
     $logger->info("stream parser received contact from $client");
 
+    my $ph = OpenSRF::Transport::PeerHandle->retrieve;
+    if(!$ph->flush_socket()) {
+        $logger->error("We received a request, bu we are no longer connected to opensrf.  ".
+            "Exiting and dropping request from $client");
+        exit;
+    }
+
     my $data;
     eval {
         local $SIG{ALRM} = sub { die "alarm\n" };



More information about the open-ils-commits mailing list