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

svn at svn.open-ils.org svn at svn.open-ils.org
Fri Jul 24 17:00:06 EDT 2009


Author: erickson
Date: 2009-07-24 17:00:01 -0400 (Fri, 24 Jul 2009)
New Revision: 13740

Modified:
   trunk/Open-ILS/src/support-scripts/marc_stream_importer.pl
Log:
reset the alarm with each socket read so that we only time out after a period of inactivity

Modified: trunk/Open-ILS/src/support-scripts/marc_stream_importer.pl
===================================================================
--- trunk/Open-ILS/src/support-scripts/marc_stream_importer.pl	2009-07-24 19:42:53 UTC (rev 13739)
+++ trunk/Open-ILS/src/support-scripts/marc_stream_importer.pl	2009-07-24 21:00:01 UTC (rev 13740)
@@ -82,10 +82,11 @@
     # and pull the data directly from the socket
     eval {
         local $SIG{ALRM} = sub { die "alarm\n" }; 
-        alarm $wait_time;
-        while(my $n = $socket->sysread($buf, $bufsize)) {
+        do {
+            alarm $wait_time;
+            last unless $socket->sysread($buf, $bufsize);
             $data .= $buf;
-        }
+        } while(1);
         alarm 0;
     };
 



More information about the open-ils-commits mailing list