Kouhei Sutou
null+****@clear*****
Tue Jul 3 14:40:45 JST 2018
Kouhei Sutou 2018-07-03 14:40:45 +0900 (Tue, 03 Jul 2018) New Revision: d667973d7f6d01087f6b89cd0dc0a45f29719016 https://github.com/groonga/groonga-query-log/commit/d667973d7f6d01087f6b89cd0dc0a45f29719016 Message: server-verifier: add --groonga*-read-timeout Modified files: lib/groonga-query-log/command/verify-server.rb lib/groonga-query-log/server-verifier.rb Modified: lib/groonga-query-log/command/verify-server.rb (+21 -0) =================================================================== --- lib/groonga-query-log/command/verify-server.rb 2018-07-03 14:34:17 +0900 (03f0452) +++ lib/groonga-query-log/command/verify-server.rb 2018-07-03 14:40:45 +0900 (e562e26) @@ -73,6 +73,13 @@ module GroongaQueryLog @options.groonga1.protocol = protocol end + parser.on("--groonga1-read-timeout=TIMEOUT", Integer, + "Timeout on reading response from Groonga server 1.", + "You can disable timeout by specifying -1.", + "(#{@options.groonga1.read_timeout})") do |timeout| + @options.groonga1.read_timeout = timeout + end + parser.on("--groonga2-host=HOST", "Host name or IP address of Groonga server 2", "[#{@options.groonga2.host}]") do |host| @@ -91,6 +98,20 @@ module GroongaQueryLog @options.groonga2.protocol = protocol end + parser.on("--groonga2-read-timeout=TIMEOUT", Integer, + "Timeout on reading response from Groonga server 2.", + "You can disable timeout by specifying -1.", + "(#{@options.groonga2.read_timeout})") do |timeout| + @options.groonga2.read_timeout = timeout + end + + parser.on("--read-timeout=TIMEOUT", Integer, + "Timeout on reading response from both Groonga servers.", + "You can disable timeout by specifying -1.") do |timeout| + @options.groonga1.read_timeout = timeout + @options.groonga2.read_timeout = timeout + end + parser.on("--n-clients=N", Integer, "The max number of concurrency", "[#{@options.n_clients}]") do |n_clients| Modified: lib/groonga-query-log/server-verifier.rb (+9 -6) =================================================================== --- lib/groonga-query-log/server-verifier.rb 2018-07-03 14:34:17 +0900 (4cf5c4c) +++ lib/groonga-query-log/server-verifier.rb 2018-07-03 14:40:45 +0900 (f1c4497) @@ -245,16 +245,19 @@ module GroongaQueryLog attr_accessor :host attr_accessor :port attr_accessor :protocol + attr_accessor :read_timeout def initialize - @host = "127.0.0.1" - @port = 10041 - @protocol = :gqtp + @host = "127.0.0.1" + @port = 10041 + @protocol = :gqtp + @read_timeout = Groonga::Client::Default::READ_TIMEOUT end def create_client(&block) - Groonga::Client.open(:host => @host, - :port => @port, - :protocol => @protocol, + Groonga::Client.open(:host => @host, + :port => @port, + :protocol => @protocol, + :read_timeout => @read_timeout, &block) end end -------------- next part -------------- HTML����������������������������... URL: https://lists.osdn.me/mailman/archives/groonga-commit/attachments/20180703/61f3efb1/attachment-0001.htm