istox 0.1.140 → 0.1.141.pre.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/istox/helpers/grpc_client.rb +19 -1
- data/lib/istox/helpers/remote_model_cache.rb +10 -5
- data/lib/istox/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1fe35ba24dbe8f1440c1e425c6906429274b90dac894b9df3928c6bd6a3b5b30
|
4
|
+
data.tar.gz: ca1e7535976d8e2784c2f06820c130418548e14a1d1a0f5313153ebae6b720c0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: de1a6e2beebc4c48933260a18a18e309b9d8e70d490b3fd7c37293b05fc94e151e40178070f6953134065166587e06739b9958a780d9dff62d8699942e3ba50e
|
7
|
+
data.tar.gz: 83543d97a1afa754f468c6a4b8ec6ef38cd5ea709ce19eb0b739d07e165afb0fe62c11c1cbabf83409d11458819342454074a82a4d6a654e71b27d7fa5c71d7a
|
data/Gemfile.lock
CHANGED
@@ -53,13 +53,31 @@ module Istox
|
|
53
53
|
|
54
54
|
log.info 'Reinitiating to grpc host at ' + host_url
|
55
55
|
t1 = Time.now
|
56
|
-
@@services[get_key(host_type, service)] = ::Gruf::Client.new(service: service, options: { hostname: host_url })
|
56
|
+
@@services[get_key(host_type, service)] = ::Gruf::Client.new(service: service, options: { hostname: host_url }, client_options: channel_options)
|
57
57
|
log.info "Time taken for reinitiating grpc host: #{Time.now - t1} seconds"
|
58
58
|
end
|
59
59
|
|
60
60
|
def get_key(host_type, service)
|
61
61
|
host_type.to_s + service.to_s
|
62
62
|
end
|
63
|
+
|
64
|
+
def channel_options
|
65
|
+
{
|
66
|
+
channel_args: default_channel_options
|
67
|
+
}
|
68
|
+
end
|
69
|
+
|
70
|
+
def default_channel_options
|
71
|
+
{
|
72
|
+
'grpc.keepalive_time_ms': 10_000, # send keepalive ping every 10 second, default is 2 hours
|
73
|
+
'grpc.keepalive_timeout_ms': 5000, # keepalive ping time out after 5 seconds, default is 20 seoncds
|
74
|
+
'grpc.keepalive_permit_without_calls': true, # allow keepalive pings when there's no gRPC calls
|
75
|
+
'grpc.http2.max_pings_without_data': 0, # allow unlimited amount of keepalive pings without data
|
76
|
+
'grpc.http2.min_time_between_pings_ms': 10_000, # allow grpc pings from client every 10 seconds
|
77
|
+
'grpc.http2.min_ping_interval_without_data_ms': 5000, # allow grpc pings from client without data every 5 seconds
|
78
|
+
'grpc.http2.max_ping_strikes': 2 # How many misbehaving pings the server can bear before sending goaway and closing the transport
|
79
|
+
}
|
80
|
+
end
|
63
81
|
end
|
64
82
|
end
|
65
83
|
end
|
@@ -15,13 +15,18 @@ module Istox
|
|
15
15
|
log.debug "Writing data to cache, key: #{key}, fields: #{fields.inspect}"
|
16
16
|
log.debug "Cache data: #{data.inspect}"
|
17
17
|
|
18
|
-
|
18
|
+
Thread.new do
|
19
|
+
data = data.to_json unless data.instance_of?(String)
|
19
20
|
|
20
|
-
|
21
|
-
|
22
|
-
|
21
|
+
results = fields.map do |f|
|
22
|
+
redis.hset(key, f.to_s, data)
|
23
|
+
end
|
23
24
|
|
24
|
-
|
25
|
+
log.debug "Cache results: #{results.inspect}"
|
26
|
+
rescue StandardError => e
|
27
|
+
log.error 'Failed to cache data'
|
28
|
+
log.error e
|
29
|
+
end
|
25
30
|
end
|
26
31
|
|
27
32
|
def remove(key:, fields: nil, field: nil)
|
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.1.
|
4
|
+
version: 0.1.141.pre.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Siong Leng
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-04-
|
11
|
+
date: 2020-04-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: awesome_print
|
@@ -471,9 +471,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
471
471
|
version: '0'
|
472
472
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
473
473
|
requirements:
|
474
|
-
- - "
|
474
|
+
- - ">"
|
475
475
|
- !ruby/object:Gem::Version
|
476
|
-
version:
|
476
|
+
version: 1.3.1
|
477
477
|
requirements: []
|
478
478
|
rubygems_version: 3.0.6
|
479
479
|
signing_key:
|