[Groonga-commit] groonga/grntest at 7239a26 [master] http: use nil instead of 0 for no timeout

Back to archive index

Kouhei Sutou null+****@clear*****
Tue Sep 6 16:49:27 JST 2016


Kouhei Sutou	2016-09-06 16:49:27 +0900 (Tue, 06 Sep 2016)

  New Revision: 7239a266d42d0f09c891e5e3c6d302b7390fe36e
  https://github.com/groonga/grntest/commit/7239a266d42d0f09c891e5e3c6d302b7390fe36e

  Message:
    http: use nil instead of 0 for no timeout

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

  Modified: lib/grntest/executors/http-executor.rb (+10 -2)
===================================================================
--- lib/grntest/executors/http-executor.rb    2016-08-30 13:12:15 +0900 (ae956ee)
+++ lib/grntest/executors/http-executor.rb    2016-09-06 16:49:27 +0900 (aebeba0)
@@ -74,7 +74,7 @@ module Grntest
         request.content_type = "application/json; charset=UTF-8"
         request.body = body
         response = Net::HTTP.start(@host, @port) do |http|
-          http.read_timeout =****@conte*****
+          http.read_timeout = read_timeout
           http.request(request)
         end
         normalize_response_data(command, response.body)
@@ -83,7 +83,7 @@ module Grntest
       def send_normal_command(command)
         url = "http://#{@host}:#{@port}#{command.to_uri_format}"
         begin
-          open(url, :read_timeout => @context.timeout) do |response|
+          open(url, :read_timeout => read_timeout) do |response|
             normalize_response_data(command, response.read)
           end
         rescue SystemCallError
@@ -101,6 +101,14 @@ module Grntest
           "#{raw_response_data}\n"
         end
       end
+
+      def read_timeout
+        if****@conte*****?
+          nil
+        else
+          @context.timeout
+        end
+      end
     end
   end
 end
-------------- next part --------------
HTML����������������������������...
Download 



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