elastictastic 0.10.3 → 0.10.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/elastictastic/adapter.rb +17 -4
- data/lib/elastictastic/version.rb +1 -1
- metadata +2 -2
@@ -53,10 +53,23 @@ module Elastictastic
|
|
53
53
|
class ExconAdapter < Adapter
|
54
54
|
|
55
55
|
def request(method, path, body = nil)
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
56
|
+
retried = false
|
57
|
+
begin
|
58
|
+
response = connection.request(
|
59
|
+
:body => body, :method => method, :path => path
|
60
|
+
)
|
61
|
+
Response.new(response.status, response.headers, response.body)
|
62
|
+
rescue Excon::Errors::SocketError => e
|
63
|
+
case e.socket_error
|
64
|
+
when Errno::EPIPE, Errno::ECONNRESET
|
65
|
+
if !retried
|
66
|
+
connection.reset
|
67
|
+
retried = true
|
68
|
+
retry
|
69
|
+
end
|
70
|
+
end
|
71
|
+
raise
|
72
|
+
end
|
60
73
|
rescue Excon::Errors::Error => e
|
61
74
|
connection.reset
|
62
75
|
raise ConnectionFailed, e
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: elastictastic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.10.
|
4
|
+
version: 0.10.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2012-09-
|
14
|
+
date: 2012-09-07 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: activesupport
|