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 +4 -4
- data/lib/active_record_host_pool/connection_adapter_mixin.rb +1 -1
- data/lib/active_record_host_pool/connection_proxy.rb +2 -0
- data/lib/active_record_host_pool/pool_proxy_6_1.rb +9 -4
- data/lib/active_record_host_pool/pool_proxy_legacy.rb +1 -1
- data/lib/active_record_host_pool/version.rb +1 -1
- metadata +3 -129
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cef6cffe1f0c00bea6d588f48093d20abb29f87e9cdab6d84eba31f9b918a44e
|
4
|
+
data.tar.gz: 9e443c3874c4b24b2955245dfa12183521386696937bc27d21ce9037b9e90ee5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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!
|
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
|
-
|
72
|
-
|
73
|
-
|
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
|
85
|
+
p.automatic_reconnect = value
|
81
86
|
end
|
82
87
|
|
83
88
|
def clear_reloadable_connections!
|
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
|
+
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-
|
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.
|
87
|
+
version: 2.7.0
|
214
88
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
215
89
|
requirements:
|
216
90
|
- - ">="
|