[Groonga-commit] groonga/grntest at aec9d5b [master] Set read timeout

Back to archive index

Kouhei Sutou null+****@clear*****
Fri Nov 22 13:58:07 JST 2013


Kouhei Sutou	2013-11-22 13:58:07 +0900 (Fri, 22 Nov 2013)

  New Revision: aec9d5b5e1d7e0ad8b565dd97bc854eaf99c561f
  https://github.com/groonga/grntest/commit/aec9d5b5e1d7e0ad8b565dd97bc854eaf99c561f

  Message:
    Set read timeout

  Modified files:
    lib/grntest/executors/http-executor.rb

  Modified: lib/grntest/executors/http-executor.rb (+3 -1)
===================================================================
--- lib/grntest/executors/http-executor.rb    2013-11-22 13:16:20 +0900 (8f81aad)
+++ lib/grntest/executors/http-executor.rb    2013-11-22 13:58:07 +0900 (4de4b0e)
@@ -26,6 +26,7 @@ module Grntest
         super(context)
         @host = host
         @port = port
+        @read_timeout = 3
       end
 
       def send_command(command)
@@ -72,6 +73,7 @@ module Grntest
         request.content_type = "application/json; charset=UTF-8"
         request.body = values
         response = Net::HTTP.start(@host, @port) do |http|
+          http.read_timeout = @read_timeout
           http.request(request)
         end
         normalize_response_data(response.body)
@@ -80,7 +82,7 @@ module Grntest
       def send_normal_command(command)
         url = "http://#{@host}:#{@port}#{command.to_uri_format}"
         begin
-          open(url) do |response|
+          open(url, :read_timeout => @read_timeout) do |response|
             normalize_response_data(response.read)
           end
         rescue OpenURI::HTTPError
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index