active_replicas 0.2.3 → 0.2.6
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c6a4d0145741bb11280305b63f67838df57b031a
|
4
|
+
data.tar.gz: 3e1b862ea6ef4523e2c29195d12ff38414f46d0a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d035452ac1147e0715590aa5f9353cf93d908d5a98c29b53cca060f2456c1bb6da4efaa5f50565050450e14d09dd6e56cc4c93cb74a1e4cec0dc92300fc01b97
|
7
|
+
data.tar.gz: 6f9ee019572a01e107456782319793bee765bf49de341f7b8f432a7a861fc80c58b16be749c4cbfb1f728f4a54abdd04f4f8af70ac91e8c335aab1b0a8a52138
|
@@ -5,6 +5,8 @@ module ActiveReplicas
|
|
5
5
|
# Wraps around Rails' `ActiveRecord::ConnectionAdapters::ConnectionHandler`
|
6
6
|
# to provide proxy wrappers around requested connections.
|
7
7
|
class ConnectionHandler
|
8
|
+
attr_accessor :proxy_configuration
|
9
|
+
|
8
10
|
def initialize(proxy_configuration:, delegate: nil, overrides: nil)
|
9
11
|
@proxy_configuration = proxy_configuration
|
10
12
|
# @delegate = delegate
|
@@ -16,6 +18,10 @@ module ActiveReplicas
|
|
16
18
|
end
|
17
19
|
|
18
20
|
def establish_connection(owner, spec)
|
21
|
+
prefix = '[ActiveReplicas::Rails4::ConnectionHandler#establish_connection]'
|
22
|
+
ActiveRecord::Base.logger&.warn "#{prefix} Ignoring spec for #{owner.inspect}: #{spec.inspect}"
|
23
|
+
ActiveRecord::Base.logger&.info "#{prefix} Called from:\n" + Kernel.caller.first(5).map {|t| " #{t}" }.join("\n")
|
24
|
+
|
19
25
|
proxying_connection_pool
|
20
26
|
end
|
21
27
|
|
@@ -43,6 +49,10 @@ module ActiveReplicas
|
|
43
49
|
end
|
44
50
|
|
45
51
|
def remove_connection(owner_klass)
|
52
|
+
remove_proxying_connection_pool
|
53
|
+
end
|
54
|
+
|
55
|
+
def remove_proxying_connection_pool
|
46
56
|
if proxying_pool = @process_to_connection_pool.delete(Process.pid)
|
47
57
|
proxying_pool.automatic_reconnect = false
|
48
58
|
proxying_pool.disconnect!
|