From 2d4ae0fe29d4170c7f8c021df58bc3a64bebe317 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Tue, 27 Sep 2011 16:14:59 -0400 Subject: [PATCH] Read STDIN up to record separator then stop The initial (and only known) target for the importer is OCLC Connexion exports, which export 1 record at a time, with each record ending with the standard record separator. There is no end-of-file / end-of-transmission indicator, so the while() loop always blocks and fails on the timeout alarm after the first record is read. Until a more flexible solution is in place, roll back support for reading multiple records via STDIN. The original commit was 679506975f0efb6e2f6f17b0c19e3c53c5bfda44 Note, the feature being rolled back was not actually necessary to implement the feature in the commit (file-based imports). It was just an added bonus. Signed-off-by: Bill Erickson --- Open-ILS/src/support-scripts/marc_stream_importer.pl | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Open-ILS/src/support-scripts/marc_stream_importer.pl b/Open-ILS/src/support-scripts/marc_stream_importer.pl index 2549222c18..d28850426a 100755 --- a/Open-ILS/src/support-scripts/marc_stream_importer.pl +++ b/Open-ILS/src/support-scripts/marc_stream_importer.pl @@ -380,10 +380,7 @@ sub process_request { # The core Net::Server method local $SIG{ALRM} = sub { die "alarm\n" }; alarm $wait_time; # prevent accidental tie ups of backend processes local $/ = "\x1D"; # MARC record separator - while (my $newline = ) { - $data .= $newline; - alarm $wait_time; # prevent accidental tie ups of backend processes - } + $data = ; alarm 0; }; -- 2.43.2