From 993c5a92e5524b2fc92dd69a7489f9eb7e6b8a49 Mon Sep 17 00:00:00 2001 From: erickson Date: Tue, 20 Jul 2010 21:16:00 +0000 Subject: [PATCH] flush the xmpp socket before attempting to process new marc stream requests git-svn-id: svn://svn.open-ils.org/ILS/trunk@16991 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/support-scripts/marc_stream_importer.pl | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Open-ILS/src/support-scripts/marc_stream_importer.pl b/Open-ILS/src/support-scripts/marc_stream_importer.pl index 99a80fc64..f04b82407 100755 --- a/Open-ILS/src/support-scripts/marc_stream_importer.pl +++ b/Open-ILS/src/support-scripts/marc_stream_importer.pl @@ -31,6 +31,7 @@ use OpenSRF::Utils::Logger qw/$logger/; 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 @@ sub process_request { # The core Net::Server method $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" }; -- 2.11.0