istox 0.1.153.3 → 0.1.153.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9b4096f33ed019f3f95ab724e4f4ed7a51e21d6a2f6b07976e0cfa948b72227f
4
- data.tar.gz: 1020dbcabba37f7ebc9e0de15483a6eacf6d13431c770575a4c57d16703ed991
3
+ metadata.gz: 65872c83f71e4c64acb4e856541411c2cf06afbb147fb500fe86d3ae647669d9
4
+ data.tar.gz: 3b6c32750ad37e9efc5412be0ee61186267f906e4e850aa5de4a39d53423f975
5
5
  SHA512:
6
- metadata.gz: ebd0b57ba71ed70e918f6f1197894956eff364eb4c9ab7b0ba347148b34ca708a0766cb33ba52b8afd9901f21b122a4dc0837fd6eac9020090fb3c788b3ec221
7
- data.tar.gz: 2d31aef7c75c48e664d6dbffe9044c7e97a8ae59bc51d4841f3f26abeec10f67cbb163169ce209ee1bcc0d0ab316d292e377750f7047bdfb61d1a67491ecf881
6
+ metadata.gz: 7b4169651c930a4fec4d685b4109388e791e8bf283c57c87754618b80a00ca650f4e128a21117b1a96afb6cdf54f0b232b68d1a8c5fcd71c1bfbec0a446c39c4
7
+ data.tar.gz: 803b1349d0ed3335dcc9994aeaeb01518c5e6a49f6523cdc904bed6083c87fdf02b69d40d0a48c8b6ed8ce3f9fece35f03ce39556ce0a169f4ab7613b6a56c34
@@ -1,7 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- istox (0.1.153)
4
+ istox (0.1.153.3)
5
+ amazing_print
5
6
  awesome_print
6
7
  binding_of_caller
7
8
  bunny (>= 2.12.0)
@@ -61,6 +62,7 @@ GEM
61
62
  i18n (>= 0.7, < 2)
62
63
  minitest (~> 5.1)
63
64
  tzinfo (~> 1.1)
65
+ amazing_print (1.1.0)
64
66
  amq-protocol (2.3.1)
65
67
  arel (9.0.0)
66
68
  awesome_print (1.8.0)
@@ -113,8 +115,8 @@ GEM
113
115
  google-protobuf (3.12.1-universal-darwin)
114
116
  googleapis-common-protos-types (1.0.5)
115
117
  google-protobuf (~> 3.11)
116
- graphlient (0.3.7)
117
- faraday
118
+ graphlient (0.4.0)
119
+ faraday (>= 1.0)
118
120
  faraday_middleware
119
121
  graphql-client
120
122
  graphql (1.10.10)
@@ -30,6 +30,7 @@ Gem::Specification.new do |spec|
30
30
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
31
31
  spec.require_paths = ['lib']
32
32
 
33
+ spec.add_dependency 'amazing_print'
33
34
  spec.add_dependency 'awesome_print'
34
35
  spec.add_dependency 'binding_of_caller'
35
36
  spec.add_dependency 'bunny', '>= 2.12.0'
@@ -32,7 +32,8 @@ module Istox
32
32
  require 'istox/helpers/common_helper'
33
33
  require 'istox/helpers/regex_helper'
34
34
  require 'istox/helpers/result_handler'
35
- require 'istox/helpers/redis'
35
+ require 'istox/helpers/redis_boot'
36
+ require 'istox/helpers/redis_manager'
36
37
  require 'istox/helpers/dlm'
37
38
  require 'istox/helpers/remote_model_cache'
38
39
 
@@ -3,9 +3,8 @@ require 'redis'
3
3
  module Istox
4
4
  class RedisBoot
5
5
  class << self
6
-
7
- def sets(k,v, options = {}, db)
8
- redis(db).set(k,v, options)
6
+ def sets(k, v, options = {}, db)
7
+ redis(db).set(k, v, options)
9
8
  end
10
9
 
11
10
  def scan(cursor, options = {}, db)
@@ -44,10 +43,12 @@ module Istox
44
43
 
45
44
  def redis(db)
46
45
  @redis = {} if @redis.nil?
47
- @redis[db] = Redis.new(
48
- url: ENV["REDIS_URL"] || 'redis://127.0.0.1',
46
+ if @redis[db].nil?
47
+ @redis[db] = Redis.new(
48
+ url: ENV['REDIS_URL'] || 'redis://127.0.0.1',
49
49
  db: db
50
- ) if @redis[db].nil?
50
+ )
51
+ end
51
52
  @redis[db]
52
53
  end
53
54
  end
@@ -0,0 +1,21 @@
1
+ module Istox
2
+ class RedisManager
3
+ class << self
4
+ # for remote model cache
5
+ def remote_model_redis
6
+ @remote_model_redis ||= Redis::Namespace.new(:platform_cache, redis: Redis.new(
7
+ url: ENV['REDIS_URL'] || 'redis://127.0.0.1:16379',
8
+ db: 5
9
+ ))
10
+ end
11
+
12
+ # cache request to prevent double submission
13
+ def request_redis
14
+ @request_redis ||= Redis::Namespace.new(:request_cache, redis: Redis.new(
15
+ url: ENV['REDIS_URL'] || 'redis://127.0.0.1:16379',
16
+ db: 6
17
+ ))
18
+ end
19
+ end
20
+ end
21
+ end
@@ -1,4 +1,5 @@
1
1
  require 'istox/helpers/logger'
2
+ require 'istox/helpers/redis_manager'
2
3
 
3
4
  module Istox
4
5
  class RemoteModelCache
@@ -77,10 +78,7 @@ module Istox
77
78
  end
78
79
 
79
80
  def redis
80
- @redis ||= Redis::Namespace.new(:platform_cache, redis: Redis.new(
81
- url: ENV['REDIS_URL'] || 'redis://127.0.0.1:16379',
82
- db: 5
83
- ))
81
+ ::Istox::RedisManager.remote_model_redis
84
82
  end
85
83
  end
86
84
  end
@@ -1,3 +1,3 @@
1
1
  module Istox
2
- VERSION = '0.1.153.3'.freeze
2
+ VERSION = '0.1.153.4'.freeze
3
3
  end
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: istox
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.153.3
4
+ version: 0.1.153.4
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-05-23 00:00:00.000000000 Z
11
+ date: 2020-05-28 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: amazing_print
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: awesome_print
15
29
  requirement: !ruby/object:Gem::Requirement
@@ -460,7 +474,8 @@ files:
460
474
  - lib/istox/helpers/order_book_prorate.rb
461
475
  - lib/istox/helpers/publisher.rb
462
476
  - lib/istox/helpers/rate_limit.rb
463
- - lib/istox/helpers/redis.rb
477
+ - lib/istox/helpers/redis_boot.rb
478
+ - lib/istox/helpers/redis_manager.rb
464
479
  - lib/istox/helpers/regex_helper.rb
465
480
  - lib/istox/helpers/remote_model_cache.rb
466
481
  - lib/istox/helpers/result_handler.rb