faraday_persistent_excon 0.2.0 → 0.2.1

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
  SHA1:
3
- metadata.gz: 2f0541e32c8035065201b31a061ef823ee0d6f69
4
- data.tar.gz: 0953f3ae6860d2ae94d1d20f41a18185f6b58045
3
+ metadata.gz: 24c41b214e0a7598075b8bf0d4a8461e352d6b18
4
+ data.tar.gz: 8cfdeb145d1dce9b049b7fb6c5d3fdafa1ee26d0
5
5
  SHA512:
6
- metadata.gz: c42d6969cae3239192270273433a0189fadee7253abb89e22fe3781778f063c3f0d3519e9d1e28260c1c87a85780e480c1c028ee607d5895d010fc0f16674819
7
- data.tar.gz: 31455c99c8c3a3a7ba7f17bad77397e24829f440c3da54d95e45a523dfd0a9e86e2899adbeb13954bd2224b875127c8f9764e1e14f597c9a0d0b69e7ab7f6deb
6
+ metadata.gz: ebdf4590de9d8b8d7a3b5e63d8f0f59dd113c17eaddc41f3bfd7653d58210d87b3166901db9f98771b10784ecd309ae1c29d6d2c8bbc656dff0cc0433152c619
7
+ data.tar.gz: 99de4dc5faa5089ee938b65be34bdc1ed976dee5bf0dc28035cc3c6929b7a25f4f5919f25803530de8725645ccb0403a4ce9aa0dd7eac8f123f1fdcbf2da6096
@@ -37,6 +37,11 @@ module FaradayPersistentExcon
37
37
  end
38
38
  end
39
39
 
40
+ if FaradayPersistentExcon.retry_idempotent_methods && FaradayPersistentExcon.idempotent_methods.include?(env[:method].to_s.upcase)
41
+ opts[:idempotent] = true
42
+ opts[:retry_limit] = FaradayPersistentExcon.retry_limit
43
+ end
44
+
40
45
  opts
41
46
  end
42
47
  end
@@ -1,3 +1,3 @@
1
1
  module FaradayPersistentExcon
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
@@ -15,11 +15,17 @@ module FaradayPersistentExcon
15
15
  attr_accessor :excon_options
16
16
  attr_accessor :perform_request_class
17
17
  attr_accessor :connection_pools
18
+ attr_accessor :idempotent_methods
19
+ attr_accessor :retry_idempotent_methods
20
+ attr_accessor :retry_limit
18
21
  end
19
22
 
20
23
  self.excon_options = {}
21
24
  self.perform_request_class = FaradayPersistentExcon::PerformRequest
22
25
  self.connection_pools = {}
26
+ self.idempotent_methods = %w[GET HEAD PUT DELETE OPTIONS TRACE]
27
+ self.retry_idempotent_methods = true
28
+ self.retry_limit = 1
23
29
  end
24
30
 
25
31
  Faraday::Adapter.register_middleware persistent_excon: ->{ FaradayPersistentExcon::Adapter }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: faraday_persistent_excon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Schlesinger