null+****@clear*****
null+****@clear*****
2012年 6月 6日 (水) 17:34:08 JST
Haruka Yoshihara 2012-06-06 17:34:08 +0900 (Wed, 06 Jun 2012)
New Revision: 4941f37d71f034da8177a84ef330c704f66b283f
Log:
Use daemon mode to wait groonga ready
Modified files:
lib/groonga/tester.rb
Modified: lib/groonga/tester.rb (+4 -5)
===================================================================
--- lib/groonga/tester.rb 2012-06-06 17:30:56 +0900 (c926a08)
+++ lib/groonga/tester.rb 2012-06-06 17:34:08 +0900 (3a8e80b)
@@ -318,17 +318,17 @@ module Groonga
def run_groonga_http(context)
host = "127.0.0.1"
port = 50041
+ pid_file = Tempfile.new("groonga.pid")
command_line = [
@tester.groonga,
"--bind-address", host,
"--port", port.to_s,
"--protocol", @tester.protocol.to_s,
- "-s",
+ "--pid-path", pid_file.path,
+ "-d",
"-n", context.db_path,
]
- env = {}
- options = {}
- pid = Process.spawn(env, *command_line, options)
+ system(*command_line)
begin
executor = HTTPExecutor.new(host, port, context)
executor.ensure_groonga_ready
@@ -338,7 +338,6 @@ module Groonga
executor.send_command("shutdown")
rescue SystemCallError
end
- Process.waitpid(pid)
end
end