istox 0.3.6.pre.cwn1 → 0.3.6.pre.cwn2
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/lib/istox/helpers/grpc_client.rb +15 -10
- data/lib/istox/helpers/sns_publisher.rb +0 -2
- data/lib/istox/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 94793125ae7e0b4b2c85e5124c1d4d342dd4610fd6afa0bdc9d5e12d9d223dc9
|
4
|
+
data.tar.gz: 166359633843ca3144d64a6082da1e84a1a8a198f2ae4ec05638790fc601c576
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: da548d031ea7c7d2a4025dbee29c6f880cbe999adbd06090efa03419b9ccae36ee58246544fe0a1d76eabce01683c459c8a56604ca42a7b49062df6829808114
|
7
|
+
data.tar.gz: 475c52070a0b9c1843958f1bca4bc56f31b8fc97748b1b347463c4bd4bcc6a67bd39de3714c4dbddcb2bae97b1b43f903a57d66f9271dc727be8ed242d5365d7
|
@@ -23,15 +23,20 @@ module Istox
|
|
23
23
|
|
24
24
|
def call(host_type, service, method, grpc_retries_count: 1, **keyword_args)
|
25
25
|
execute(host_type, service, method, **keyword_args)
|
26
|
-
rescue Gruf::Client::Errors
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
26
|
+
rescue Gruf::Client::Errors => e
|
27
|
+
if e.is_a? Gruf::Client::Errors::Unavailable
|
28
|
+
# will retry three times with 1 seconds sleep between if there is a Unavailable error thrown from GRPC
|
29
|
+
if grpc_retries_count < 3
|
30
|
+
log.warn "GRPC failed to connect to #{host_type}, retrying after 1 seconds, retry count: #{grpc_retries_count}/3"
|
31
|
+
sleep 1
|
32
|
+
reinitiate_service(host_type, service)
|
33
|
+
call(host_type, service, method, grpc_retries_count: grpc_retries_count + 1, **keyword_args)
|
34
|
+
else
|
35
|
+
log.fatal "GRPC unable connect to #{host_type}, throwing exception now."
|
36
|
+
raise e
|
37
|
+
end
|
33
38
|
else
|
34
|
-
log.
|
39
|
+
log.info e
|
35
40
|
raise e
|
36
41
|
end
|
37
42
|
end
|
@@ -69,10 +74,10 @@ module Istox
|
|
69
74
|
grpc_client = @@services[get_key(host_type, service)]
|
70
75
|
|
71
76
|
if grpc_client
|
72
|
-
|
77
|
+
grpc_client
|
73
78
|
else
|
74
79
|
reinitiate_service(host_type, service)
|
75
|
-
|
80
|
+
@@services[get_key(host_type, service)]
|
76
81
|
end
|
77
82
|
end
|
78
83
|
|
data/lib/istox/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: istox
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.6.pre.
|
4
|
+
version: 0.3.6.pre.cwn2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Siong Leng
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-04-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: amazing_print
|