[Groonga-commit] groonga/groonga [master] doc: reduce command result waiting time

Back to archive index

null+****@clear***** null+****@clear*****
2012年 7月 8日 (日) 20:07:22 JST


Kouhei Sutou	2012-07-08 20:07:22 +0900 (Sun, 08 Jul 2012)

  New Revision: 59b63d111cb1632361842bb3f0030f244d466223
  https://github.com/groonga/groonga/commit/59b63d111cb1632361842bb3f0030f244d466223

  Log:
    doc: reduce command result waiting time

  Modified files:
    doc/update_execution_example.py

  Modified: doc/update_execution_example.py (+8 -1)
===================================================================
--- doc/update_execution_example.py    2012-07-08 19:57:52 +0900 (bdb86aa)
+++ doc/update_execution_example.py    2012-07-08 20:07:22 +0900 (8f01278)
@@ -52,6 +52,7 @@ def execmd(command, fout):
   groonga_process.stdin.write(command + "\n")
   groonga_process.stdin.flush()
   is_command = re.match("[a-z/]", command)
+  is_load_command = re.match("load ", command)
   is_console = not re.match("/", command)
   if fout:
     if is_console:
@@ -61,11 +62,17 @@ def execmd(command, fout):
     formatted_command_line = prefix + command + "\n"
     fout.write(formatted_command_line)
   is_load_data_end = re.match("^\]", command)
+  if is_load_command:
+    return
   if not is_command and not is_load_data_end:
     return
   output_buffer = ""
+  first_timeout = 1
+  rest_timeout = 0.1
+  timeout = first_timeout
   while True:
-    out = select([groonga_process.stdout], [], [], 0.2)
+    out = select([groonga_process.stdout], [], [], timeout)
+    timeout = rest_timeout
     if len(out[0]):
       char = groonga_process.stdout.read(1)
       if char is None:
-------------- next part --------------
HTML$B$NE:IU%U%!%$%k$rJ]4I$7$^$7$?(B...
下载 



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