embulk-input-marketo 0.2.3 → 0.2.4
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 +4 -4
- data/CHANGELOG.md +4 -0
- data/embulk-input-marketo.gemspec +1 -1
- data/lib/embulk/input/marketo_api/soap/base.rb +17 -1
- data/test/embulk/input/marketo_api/soap/test_base.rb +12 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 91632886c4d5a336024869408d4d1d877aa05882
|
4
|
+
data.tar.gz: 22c4f6b1fdba1db3ff1f00898becd767f91655c8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3aef455faff03669b183c791c58d9643e180d29ec2d87c103dcaf6833129e9fa5efe45d970d639c65244a67324fd32b1e7c91f236be6cfbc83bb957a2082891a
|
7
|
+
data.tar.gz: 61dfcebdd98dbfccd44b0842b88a4aee32b01311bb40853e3bc9dd71b9cfe5435373d504550ebf188076a18b10db15a0d0f1cbde18e06f976a7112f7f05067f4
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
## 0.2.4 - 2015-09-17
|
2
|
+
|
3
|
+
* [enhancement] Retry to call API until 5 times when Timeout [#36](https://github.com/treasure-data/embulk-input-marketo/pull/36) [[Reported by @muga](https://github.com/treasure-data/embulk-input-marketo/issues/34). Thanks!]
|
4
|
+
|
1
5
|
## 0.2.3 - 2015-09-14
|
2
6
|
|
3
7
|
* [enhancement] Catch config error [#33](https://github.com/treasure-data/embulk-input-marketo/pull/33)
|
@@ -7,6 +7,8 @@ module Embulk
|
|
7
7
|
class Base
|
8
8
|
attr_reader :endpoint, :wsdl, :user_id, :encryption_key
|
9
9
|
|
10
|
+
RETRY_TIMEOUT_COUNT = 5
|
11
|
+
|
10
12
|
def initialize(endpoint, wsdl, user_id, encryption_key)
|
11
13
|
@endpoint = endpoint
|
12
14
|
@wsdl = wsdl
|
@@ -40,7 +42,9 @@ module Embulk
|
|
40
42
|
|
41
43
|
def savon_call(operation, locals={})
|
42
44
|
catch_unretryable_error do
|
43
|
-
|
45
|
+
with_retry do
|
46
|
+
savon.call(operation, locals.merge(advanced_typecasting: false))
|
47
|
+
end
|
44
48
|
end
|
45
49
|
end
|
46
50
|
|
@@ -55,6 +59,18 @@ module Embulk
|
|
55
59
|
}
|
56
60
|
end
|
57
61
|
|
62
|
+
def with_retry(&block)
|
63
|
+
count = 0
|
64
|
+
begin
|
65
|
+
yield
|
66
|
+
rescue ::Timeout::Error => e
|
67
|
+
count += 1
|
68
|
+
raise e if count > RETRY_TIMEOUT_COUNT
|
69
|
+
Embulk.logger.warn "TimeoutError [#{count}/#{RETRY_TIMEOUT_COUNT}]. Retrying..."
|
70
|
+
retry
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
58
74
|
def catch_unretryable_error(&block)
|
59
75
|
yield
|
60
76
|
rescue Savon::SOAPFault => e
|
@@ -8,6 +8,18 @@ module Embulk
|
|
8
8
|
class BaseTest < Test::Unit::TestCase
|
9
9
|
include LeadFixtures
|
10
10
|
|
11
|
+
def test_with_retry
|
12
|
+
any_instance_of(Savon::Client) do |klass|
|
13
|
+
stub(klass).call(:timeout_test, advanced_typecasting: false) { raise ::Timeout::Error }
|
14
|
+
end
|
15
|
+
|
16
|
+
mock(Embulk.logger).warn(/TimeoutError/).times(Base::RETRY_TIMEOUT_COUNT)
|
17
|
+
|
18
|
+
assert_raise(::Timeout::Error) do
|
19
|
+
soap.send(:savon_call, :timeout_test)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
11
23
|
class TestSignature < self
|
12
24
|
def setup
|
13
25
|
@signature = soap.__send__(:signature)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: embulk-input-marketo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- uu59
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-09-
|
12
|
+
date: 2015-09-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|