soaspec 0.3.8 → 0.3.9

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
  SHA256:
3
- metadata.gz: 25c76a735c83804a77a35c7bcbd85a3e1c837d5ffd801189f0601100ebd21d35
4
- data.tar.gz: 8caeba76b839c267b1abb73700046e623f53a6c5f71e891607a5460a8a449d11
3
+ metadata.gz: a62c78f628d87375f05c3dca678049737671a395cdc94cd0dc210ab24fd6e2e8
4
+ data.tar.gz: 0d295df645f3ba7b66ca202d3fabf2b43d5e6a4f7d1e9fceda654a816ae7d26d
5
5
  SHA512:
6
- metadata.gz: d999196f69ccdd587b05ede48ba7bf276b2b8d04afe8fa68e56302041a93bde41a1bb802729ce614232121626b9ae31e65a41c34f657e637e8575eefb2a1a0ca
7
- data.tar.gz: ba87bbdcad28c84b19542b5a8d156a4d1922ce303f5b7b640e9ed6d91dd75cc68fe7a5df374c516235cb624d3e1913d2432df98acd477a551fb67418625e6772
6
+ metadata.gz: 7b026f3949b1cee51b90e17a72130106897d52e50b4d68d663aad32c76a3a9d57f3290fc8b1b31ee9bde4411a10364c90e35341e90abbadabd1f0684db5cc718
7
+ data.tar.gz: 6e2efcdeb04dc8bb0b4afe6e15856a611e7f11525b16064a143c76673f9653c2e83715553b20371bfd47050a7ace7c64e950993458ec8076f33f7270f16bedd1
data/ChangeLog CHANGED
@@ -1,3 +1,7 @@
1
+ Version 0.3.9
2
+ * Enhancement
3
+ * Have default RestHandler::RestRequest::MAX_SOCKET_RETRIES to handle intermittent SocketErrors
4
+
1
5
  Version 0.3.8
2
6
  * Bug fix
3
7
  * Assigning default handler without overriding params was failing due to invalid default value
@@ -28,6 +28,10 @@ module Soaspec
28
28
  attr_accessor :headers
29
29
  # @return [Soaspec::RestHandler] RestHandler used for this request
30
30
  attr_accessor :rest_handler
31
+ # @return [Integer] Maximum number of times to retry for a socket error
32
+ MAX_SOCKET_RETRIES = 3
33
+ # @return [Integer] Attempts to try socket
34
+ attr_accessor :socket_tries
31
35
 
32
36
  # @return [String] Base url plus sub url
33
37
  def full_url
@@ -62,6 +66,7 @@ module Soaspec
62
66
  # @param [Hash] options Headers and basic auth options
63
67
  # @param [< Soaspec::RestHandler] rest_handler RestHandler handling creation of this request
64
68
  def initialize(overall, options, rest_handler)
69
+ self.socket_tries = 0
65
70
  self.rest_handler = rest_handler
66
71
  overall_params = interpret_parameters(overall)
67
72
  @overall_params = overall_params.dup
@@ -123,6 +128,11 @@ module Soaspec
123
128
  raise e unless e.respond_to? :response
124
129
 
125
130
  e.response
131
+ rescue SocketError => e
132
+ self.socket_tries += 1
133
+ sleep 0.5
134
+ retry unless socket_tries > MAX_SOCKET_RETRIES
135
+ raise e
126
136
  end
127
137
 
128
138
  # Work out data to send based upon payload, template_name, or body
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Soaspec
4
4
  # @return [String] Version of the gem
5
- VERSION = '0.3.8'
5
+ VERSION = '0.3.9'
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: soaspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.8
4
+ version: 0.3.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - SamuelGarrattIQA
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-12-01 00:00:00.000000000 Z
11
+ date: 2020-02-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler