faraday_persistent_excon 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 24c41b214e0a7598075b8bf0d4a8461e352d6b18
|
4
|
+
data.tar.gz: 8cfdeb145d1dce9b049b7fb6c5d3fdafa1ee26d0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
@@ -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 }
|