active_record_host_pool 1.2.4 → 1.2.5

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: 3f3e4946feb2a146c7dd715f51c583dc6bc9723fe08491023ec85adac537a22b
4
- data.tar.gz: 708604983ef9815557c23c13ce88fb40588f4eb62ce4cf4e5363bd2a2f2eec2a
3
+ metadata.gz: cef6cffe1f0c00bea6d588f48093d20abb29f87e9cdab6d84eba31f9b918a44e
4
+ data.tar.gz: 9e443c3874c4b24b2955245dfa12183521386696937bc27d21ce9037b9e90ee5
5
5
  SHA512:
6
- metadata.gz: d67cdfa238ffb5a68f333a86eda8855e25b3e763f1bc1b5e8abb11766d48e524de7d48745229f62f241b17cd79c699e40ab8561995875771133ae7b28cfca3d4
7
- data.tar.gz: 2dac7894db1c4b33c66924323578464929aeb370d6a79dfeab9c8ecb597bcb5299ab5de1294c41d7a68e949637f897928e54e8e3c4b8090300576a4e8976001e
6
+ metadata.gz: 2cadfa3a2d2c582a71a3538692edd4fbde67e2266f98d6fdcc1133d40bd0db33969eca2ef1a0ef8ccb22b20a01fb263d76a7cfa88a877b3ac46b7d19d1852346
7
+ data.tar.gz: 1ddd95edd00b9bd496cb861db3ecbc7be607c0174ca59e68ca4eebf2546137dff24881d4a6d3d4cc940fabcc1d5a1c9e7477df14c744f9e00814d7bcf5b5d29a
@@ -74,7 +74,7 @@ module ActiveRecordHostPool
74
74
  @connection.object_id != @_cached_connection_object_id
75
75
  )
76
76
  log("select_db #{_host_pool_current_database}", "SQL") do
77
- clear_cache! if respond_to?(:clear_cache!)
77
+ clear_cache!
78
78
  raw_connection.select_db(_host_pool_current_database)
79
79
  end
80
80
  @_cached_current_database = _host_pool_current_database
@@ -50,11 +50,13 @@ module ActiveRecordHostPool
50
50
  __getobj__.send(symbol, *args, &blk)
51
51
  end
52
52
  end
53
+ ruby2_keywords :send if respond_to?(:ruby2_keywords, true)
53
54
 
54
55
  private
55
56
 
56
57
  def select(*args)
57
58
  @cx.__send__(:select, *args)
58
59
  end
60
+ ruby2_keywords :select if respond_to?(:ruby2_keywords, true)
59
61
  end
60
62
  end
@@ -3,6 +3,7 @@
3
3
  require 'delegate'
4
4
  require 'active_record'
5
5
  require 'active_record_host_pool/connection_adapter_mixin'
6
+ require 'mutex_m'
6
7
 
7
8
  # this module sits in between ConnectionHandler and a bunch of different ConnectionPools (one per host).
8
9
  # when a connection is requested, it goes like:
@@ -15,6 +16,8 @@ require 'active_record_host_pool/connection_adapter_mixin'
15
16
  module ActiveRecordHostPool
16
17
  # Sits between ConnectionHandler and a bunch of different ConnectionPools (one per host).
17
18
  class PoolProxy < Delegator
19
+ include Mutex_m
20
+
18
21
  def initialize(pool_config)
19
22
  super(pool_config)
20
23
  @pool_config = pool_config
@@ -68,16 +71,18 @@ module ActiveRecordHostPool
68
71
  p = _connection_pool(false)
69
72
  return unless p
70
73
 
71
- p.disconnect!
72
- p.automatic_reconnect = true if p.respond_to?(:automatic_reconnect=)
73
- _clear_connection_proxy_cache
74
+ synchronize do
75
+ p.disconnect!
76
+ p.automatic_reconnect = true
77
+ _clear_connection_proxy_cache
78
+ end
74
79
  end
75
80
 
76
81
  def automatic_reconnect=(value)
77
82
  p = _connection_pool(false)
78
83
  return unless p
79
84
 
80
- p.automatic_reconnect = value if p.respond_to?(:automatic_reconnect=)
85
+ p.automatic_reconnect = value
81
86
  end
82
87
 
83
88
  def clear_reloadable_connections!
@@ -71,7 +71,7 @@ module ActiveRecordHostPool
71
71
  return unless p
72
72
 
73
73
  p.disconnect!
74
- p.automatic_reconnect = true if p.respond_to?(:automatic_reconnect=)
74
+ p.automatic_reconnect = true
75
75
  _clear_connection_proxy_cache
76
76
  end
77
77
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ActiveRecordHostPool
4
- VERSION = "1.2.4"
4
+ VERSION = "1.2.5"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_record_host_pool
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.4
4
+ version: 1.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Benjamin Quorning
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2023-03-20 00:00:00.000000000 Z
14
+ date: 2023-07-14 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: activerecord
@@ -47,132 +47,6 @@ dependencies:
47
47
  - - ">="
48
48
  - !ruby/object:Gem::Version
49
49
  version: '0'
50
- - !ruby/object:Gem::Dependency
51
- name: bump
52
- requirement: !ruby/object:Gem::Requirement
53
- requirements:
54
- - - ">="
55
- - !ruby/object:Gem::Version
56
- version: '0'
57
- type: :development
58
- prerelease: false
59
- version_requirements: !ruby/object:Gem::Requirement
60
- requirements:
61
- - - ">="
62
- - !ruby/object:Gem::Version
63
- version: '0'
64
- - !ruby/object:Gem::Dependency
65
- name: minitest
66
- requirement: !ruby/object:Gem::Requirement
67
- requirements:
68
- - - ">="
69
- - !ruby/object:Gem::Version
70
- version: 5.10.0
71
- type: :development
72
- prerelease: false
73
- version_requirements: !ruby/object:Gem::Requirement
74
- requirements:
75
- - - ">="
76
- - !ruby/object:Gem::Version
77
- version: 5.10.0
78
- - !ruby/object:Gem::Dependency
79
- name: minitest-fail-fast
80
- requirement: !ruby/object:Gem::Requirement
81
- requirements:
82
- - - ">="
83
- - !ruby/object:Gem::Version
84
- version: '0'
85
- type: :development
86
- prerelease: false
87
- version_requirements: !ruby/object:Gem::Requirement
88
- requirements:
89
- - - ">="
90
- - !ruby/object:Gem::Version
91
- version: '0'
92
- - !ruby/object:Gem::Dependency
93
- name: minitest-line
94
- requirement: !ruby/object:Gem::Requirement
95
- requirements:
96
- - - ">="
97
- - !ruby/object:Gem::Version
98
- version: '0'
99
- type: :development
100
- prerelease: false
101
- version_requirements: !ruby/object:Gem::Requirement
102
- requirements:
103
- - - ">="
104
- - !ruby/object:Gem::Version
105
- version: '0'
106
- - !ruby/object:Gem::Dependency
107
- name: minitest-mock_expectations
108
- requirement: !ruby/object:Gem::Requirement
109
- requirements:
110
- - - "~>"
111
- - !ruby/object:Gem::Version
112
- version: 1.1.3
113
- type: :development
114
- prerelease: false
115
- version_requirements: !ruby/object:Gem::Requirement
116
- requirements:
117
- - - "~>"
118
- - !ruby/object:Gem::Version
119
- version: 1.1.3
120
- - !ruby/object:Gem::Dependency
121
- name: phenix
122
- requirement: !ruby/object:Gem::Requirement
123
- requirements:
124
- - - ">="
125
- - !ruby/object:Gem::Version
126
- version: 1.0.1
127
- type: :development
128
- prerelease: false
129
- version_requirements: !ruby/object:Gem::Requirement
130
- requirements:
131
- - - ">="
132
- - !ruby/object:Gem::Version
133
- version: 1.0.1
134
- - !ruby/object:Gem::Dependency
135
- name: pry-byebug
136
- requirement: !ruby/object:Gem::Requirement
137
- requirements:
138
- - - "~>"
139
- - !ruby/object:Gem::Version
140
- version: '3.9'
141
- type: :development
142
- prerelease: false
143
- version_requirements: !ruby/object:Gem::Requirement
144
- requirements:
145
- - - "~>"
146
- - !ruby/object:Gem::Version
147
- version: '3.9'
148
- - !ruby/object:Gem::Dependency
149
- name: rake
150
- requirement: !ruby/object:Gem::Requirement
151
- requirements:
152
- - - ">="
153
- - !ruby/object:Gem::Version
154
- version: 12.0.0
155
- type: :development
156
- prerelease: false
157
- version_requirements: !ruby/object:Gem::Requirement
158
- requirements:
159
- - - ">="
160
- - !ruby/object:Gem::Version
161
- version: 12.0.0
162
- - !ruby/object:Gem::Dependency
163
- name: rubocop
164
- requirement: !ruby/object:Gem::Requirement
165
- requirements:
166
- - - "~>"
167
- - !ruby/object:Gem::Version
168
- version: 0.80.0
169
- type: :development
170
- prerelease: false
171
- version_requirements: !ruby/object:Gem::Requirement
172
- requirements:
173
- - - "~>"
174
- - !ruby/object:Gem::Version
175
- version: 0.80.0
176
50
  description: ''
177
51
  email:
178
52
  - bquorning@zendesk.com
@@ -210,7 +84,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
210
84
  requirements:
211
85
  - - ">="
212
86
  - !ruby/object:Gem::Version
213
- version: 2.6.0
87
+ version: 2.7.0
214
88
  required_rubygems_version: !ruby/object:Gem::Requirement
215
89
  requirements:
216
90
  - - ">="