faraday-throttler-rx 0.0.6 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4b4d9bed4de87645679ba476eced15a525516375df5bd3b71431e9342b56997e
4
- data.tar.gz: 7e0a2f1a0a01621b56737e40f08a5da6642eb53a2ef2dd2b70a86c834e076834
3
+ metadata.gz: 010e832af2e263e60bc76346f22620976f8b0a9a169d916c9929a004909ec5c0
4
+ data.tar.gz: dc4043fe5b8a4333ef456981b2a8bc3d7ecef535aba2bb11471d6e3088639b8e
5
5
  SHA512:
6
- metadata.gz: fcefae47311b805e92d57b767d5e7e1bcb867da116dc1209fa83293ba384e44acba1eb455d478f7a0b2e38499cb59f540973692f25ad0bbb38485d80d74ea1ae
7
- data.tar.gz: 5a3a84912f922df0d58bb1fcf51ffd3bd832106274afe899560c9cf9db7c4734527212cee41954e56c3c8bb3321d5689140d1a036b9b30d28ef50cc4e8042c9b
6
+ metadata.gz: 99503113453a6c9107d68a5e1240cfb3507b1376fa1a7bb91fafd62949628326f2a9040d6c7047d4ca78ef1d31055244d3a35a958c3da7fcbc70c8c5c183d34e
7
+ data.tar.gz: c1eb7322b9240e8abc6ef153ee8aca7c4ca28fd878e9da984158b73ebd9fe9e83a1dd94ff6643a1ce1bf8fa60e07954f6c757a2dff85529b95e035d710ce7929
data/examples/client.rb CHANGED
@@ -6,7 +6,7 @@ require 'faraday_throttler/redis_cache'
6
6
 
7
7
 
8
8
  redis = Redis.new
9
- cache = FaradayThrottler::RedisCache.new(redis: redis, ttl: 60)
9
+ cache = FaradayThrottler::RedisCache.new(redis: redis, default_ttl: 60)
10
10
 
11
11
  conn = Faraday.new(:url => 'http://localhost:9800') do |faraday|
12
12
  # faraday.response :logger # log requests to STDOUT
@@ -105,10 +105,11 @@ module FaradayThrottler
105
105
  release_request_stick(cache_key)
106
106
  end
107
107
  end
108
- rescue Faraday::ClientError => e
109
- if rate_limit_response_checker.call(e.response)
108
+ rescue Faraday::Error => e
109
+ if e.is_a?(Faraday::ClientError) && rate_limit_response_checker.call(e.response)
110
110
  wait_and_replay_call(request_env, cache_key, start)
111
111
  else
112
+ release_request_stick(cache_key)
112
113
  raise e
113
114
  end
114
115
  end
@@ -1,3 +1,3 @@
1
1
  module FaradayThrottler
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: faraday-throttler-rx
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Boris Koumondji