Skip to content

Commit

Permalink
Merge pull request Kount#2 from romul/timeout
Browse files Browse the repository at this point in the history
All requests to Kount should be limited by timeout
  • Loading branch information
Greg Davis authored Aug 16, 2016
2 parents a0d2413 + efd820b commit 18b6056
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Ruby/lib/kount/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,12 @@ def initialize(params = {})
# @return [Hash] RIS response formatted into a native hash
def get_response(request)
params = prepare_request_params(request)
response = RestClient::Resource.new(
endpoint,
verify_ssl: verify_ssl_option).post params, x_kount_api_key: key
response = {}
begin
response = RestClient::Resource.new(
endpoint,
verify_ssl: verify_ssl_option, timeout: 1).post params, x_kount_api_key: key

JSON.parse(response)
rescue
# RIS errors do not come back as JSON, so just pass them along raw.
Expand Down

0 comments on commit 18b6056

Please sign in to comment.