sentry_top_errors 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sentry_top_errors/sentry_client.rb +7 -1
- data/senrty_top_errors.gemspec +1 -1
- data/templates/index.html +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 017aaf67e975307e6723dc0e0989e1aec7275cfdfdec7759a6c175f50d7c9f31
|
4
|
+
data.tar.gz: 0147ccc8ff0eb09478ebe3b689bf9ae799941eff9c6f71005f7d7b50f81cd788
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fe9aa97a6f56039cce05c72db603fdd10d046194a3d1478a544d8bb922812614ac31c6e95e72aada148b2d7f2bf0dda4888873acfee685b051164423e85ff45e
|
7
|
+
data.tar.gz: 911f1c7fb17ef9d8071f30cd641ee3b1b3da09fe7f74fc6650cba1edd79d88423ccc35af8103b92dbfe7eb4d8eb1336e0aef6d90fc735652f0c2bcd73230bf18
|
@@ -13,12 +13,18 @@ class SentryTopErrors::SentryClient
|
|
13
13
|
@enable_cache = enable_cache
|
14
14
|
end
|
15
15
|
|
16
|
-
def http(method, path, options = {})
|
16
|
+
def http(method, path, options = {}, retry_count = 0)
|
17
17
|
@conn ||= Excon.new(SENTRY_HOST, HTTP_OPTIONNS)
|
18
18
|
options[:headers] ||= {}
|
19
19
|
options[:headers]['Authorization'] ||= "Bearer #{@sentry_key}"
|
20
20
|
response = @conn.request({method: method, path: path}.merge(options))
|
21
21
|
|
22
|
+
# status 429 = too many requests
|
23
|
+
if response.status == 429 && retry_count < 4
|
24
|
+
sleep(0.2)
|
25
|
+
return http(method, path, options, retry_count + 1)
|
26
|
+
end
|
27
|
+
|
22
28
|
SentryTopErrors::ApiResponse.new_from_res(response)
|
23
29
|
end
|
24
30
|
|
data/senrty_top_errors.gemspec
CHANGED
data/templates/index.html
CHANGED