[Groonga-commit] groonga/groonga-test [master] Read command output as fast as possible

Back to archive index

null+****@clear***** null+****@clear*****
2012年 3月 2日 (金) 18:11:49 JST


Kouhei Sutou	2012-03-02 18:11:49 +0900 (Fri, 02 Mar 2012)

  New Revision: 137dd5944ec433c01e15e62e4df89ac52986af89

  Log:
    Read command output as fast as possible

  Modified files:
    bin/groonga-test

  Modified: bin/groonga-test (+4 -2)
===================================================================
--- bin/groonga-test    2012-03-02 18:01:05 +0900 (2072078)
+++ bin/groonga-test    2012-03-02 18:11:49 +0900 (30262a8)
@@ -83,7 +83,6 @@ class GroongaTester
           end
           io.close_write
         end
-        result << read_output(io, 1)
       end
     end
     result
@@ -110,11 +109,14 @@ class GroongaTester
     end
   end
 
-  def read_output(io, timeout=0)
+  def read_output(io)
     output = ""
+    first_timeout = 1
+    timeout = first_timeout
     while IO.select([io], [], [], timeout)
       break if io.eof?
       output << io.readpartial(65535)
+      timeout = 0
     end
     output
   end




Groonga-commit メーリングリストの案内
Back to archive index