From: erickson Date: Tue, 20 Jul 2010 21:16:00 +0000 (+0000) Subject: flush the xmpp socket before attempting to process new marc stream requests X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=993c5a92e5524b2fc92dd69a7489f9eb7e6b8a49;p=evergreen%2Fpines.git 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 --- diff --git a/Open-ILS/src/support-scripts/marc_stream_importer.pl b/Open-ILS/src/support-scripts/marc_stream_importer.pl index 99a80fc646..f04b82407c 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" };