A little more work for each connection, but this should be slightly more robust
git-svn-id: file:///home/svn/framework3/trunk@8895 4d416f70-5f16-0410-b530-b9f4589650daunstable
parent
e28e4ac923
commit
756e00c3bb
|
@ -60,6 +60,10 @@ class APIRequest
|
|||
attr_reader :trace
|
||||
|
||||
def initialize(req, url)
|
||||
prepare_http_client
|
||||
end
|
||||
|
||||
def prepare_http_client
|
||||
@retry_count = 0
|
||||
@retry_count_max = 10
|
||||
@time_out = 30
|
||||
|
@ -83,6 +87,7 @@ class APIRequest
|
|||
@conn_tries = 0
|
||||
|
||||
begin
|
||||
prepare_http_client
|
||||
resp, data = @http.post(@uri.path, @req, @headers)
|
||||
@res = parse_xml(data)
|
||||
|
||||
|
|
Loading…
Reference in New Issue