Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

added retries on worker queue #21

Closed
wants to merge 1 commit into from

2 participants

@rkononov
Collaborator

bugfix for Typhoeus Timeout Issue

@treeder treeder closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 24, 2012
  1. added retries

    rkononov authored
This page is out of date. Refresh to see the latest.
Showing with 9 additions and 1 deletion.
  1. +9 −1 lib/iron_worker/api.rb
View
10 lib/iron_worker/api.rb
@@ -166,7 +166,15 @@ def post(method, params={}, options={})
logger.debug 'body=' + json
req_hash = common_req_hash
req_hash[:body] = json
- response = @uber_client.post(url, req_hash)
+ begin
+ response = @uber_client.post(url, req_hash)
+ rescue Rest::Wrappers::TyphoeusTimeoutError => ex
+ retries ||= 0
+ retries += 1
+ logger.debug "Timed out retrying... #{retries}"
+ raise ex if retries >= 5
+ retry
+ end
#response = @http_sess.post(url, json, {"Content-Type" => 'application/json'})
check_response(response)
logger.debug 'response: ' + response.inspect
Something went wrong with that request. Please try again.