embulk-input-mixpanel 0.4.5 → 0.4.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/embulk-input-mixpanel.gemspec +1 -1
- data/lib/embulk/input/mixpanel_api/client.rb +4 -0
- data/test/embulk/input/mixpanel_api/test_client.rb +18 -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: 29de18241b68feaf375ea8e5b75f0bf6c79063a9
|
4
|
+
data.tar.gz: 8f05066de1a870556450100082f3928b8a8655dc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c15de7628ef891132049c4f6137774bdf4315427e9e0d7c4c6cc29d8f0deaec4dad849b9985fc65c6f2214d4e3130f45460290f5d7e3bb35b53ec65596617d10
|
7
|
+
data.tar.gz: 9390d1fbe6e20e773b6ef2ef23f40a9b2922556496b597604692ce22be498776e0b00cba423b995f106ee7fb21fcdf4f719ba47a87c3800201a8af9810e0e224
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
## 0.4.6 - 2016-09-07
|
2
|
+
* [enhancement] Retry with too frequency requests error [#44](https://github.com/treasure-data/embulk-input-mixpanel/pull/44)
|
3
|
+
|
1
4
|
## 0.4.5 - 2016-09-05
|
2
5
|
* [fixed] Don't try to guess future date [#43](https://github.com/treasure-data/embulk-input-mixpanel/pull/43)
|
3
6
|
|
@@ -131,6 +131,10 @@ module Embulk
|
|
131
131
|
Embulk.logger.debug "response code: #{response.code}"
|
132
132
|
case response.code
|
133
133
|
when 400..499
|
134
|
+
if response.code == 429
|
135
|
+
# [429] {"error": "too many export requests in progress for this project"}
|
136
|
+
raise RuntimeError.new("[#{response.code}] #{response.body} (will retry)")
|
137
|
+
end
|
134
138
|
raise ConfigError.new("[#{response.code}] #{response.body}")
|
135
139
|
when 500..599
|
136
140
|
raise RuntimeError.new("[#{response.code}] #{response.body}")
|
@@ -98,6 +98,15 @@ module Embulk
|
|
98
98
|
end
|
99
99
|
end
|
100
100
|
|
101
|
+
def test_retry_for_429_temporary_fail
|
102
|
+
stub_client
|
103
|
+
stub_response(failure_response(429))
|
104
|
+
|
105
|
+
assert_raise(RuntimeError) do
|
106
|
+
@client.export(params)
|
107
|
+
end
|
108
|
+
end
|
109
|
+
|
101
110
|
class ExportSmallDataset < self
|
102
111
|
def test_to_date_after_1_day
|
103
112
|
to = (Date.parse(params["from_date"]) + 1).to_s
|
@@ -106,6 +115,15 @@ module Embulk
|
|
106
115
|
@client.export_for_small_dataset(params)
|
107
116
|
end
|
108
117
|
|
118
|
+
def test_retry_for_429_temporary_fail
|
119
|
+
stub_client
|
120
|
+
stub_response(failure_response(429))
|
121
|
+
|
122
|
+
assert_raise(RuntimeError) do
|
123
|
+
@client.export_for_small_dataset(params)
|
124
|
+
end
|
125
|
+
end
|
126
|
+
|
109
127
|
def test_to_date_after_1_day_after_10_days_if_empty
|
110
128
|
stub_client
|
111
129
|
to1 = (Date.parse(params["from_date"]) + 1).to_s
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: embulk-input-mixpanel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- yoshihara
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-09-
|
12
|
+
date: 2016-09-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|