active_replicas 0.1.1 → 0.1.2
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 +4 -4
- data/lib/active_replicas/rails4/connection_handler.rb +10 -2
- data/lib/active_replicas/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 12543c609a56645522b185ac709b69e9acfc3a92
|
|
4
|
+
data.tar.gz: 8b3009b7ba30137204b742ec39794e1e13702036
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b1409e66dabb4e520b0f903d60749681372177b3aaa69beb8a4b07467eb74db08c0d118d7831d5aee1ae633715eb11d1a264697a298537e760d88bf478a6599c
|
|
7
|
+
data.tar.gz: da45f12c15c38eb999f8de4d267933301040a0dd949e96b982c518236077d9a532df21d10a26318edfc0008a9a38144cfa69c9264ecad8893ecb2ec5d32287ba
|
|
@@ -7,8 +7,8 @@ module ActiveReplicas
|
|
|
7
7
|
class ConnectionHandler
|
|
8
8
|
def initialize(proxy_configuration:, delegate: nil, overrides: nil)
|
|
9
9
|
@proxy_configuration = proxy_configuration
|
|
10
|
-
@delegate
|
|
11
|
-
@overrides
|
|
10
|
+
# @delegate = delegate
|
|
11
|
+
# @overrides = Set.new(overrides || [])
|
|
12
12
|
|
|
13
13
|
# Each process will get its own map of connection keys to database
|
|
14
14
|
# connection instances.
|
|
@@ -42,6 +42,14 @@ module ActiveReplicas
|
|
|
42
42
|
pool && pool.connected?
|
|
43
43
|
end
|
|
44
44
|
|
|
45
|
+
def remove_connection(owner_klass)
|
|
46
|
+
if pool = @process_to_connection_pool.delete(Process.pid)
|
|
47
|
+
pool.automatic_reconnect = false
|
|
48
|
+
pool.disconnect!
|
|
49
|
+
pool.spec.config
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
|
|
45
53
|
def proxying_connection_pool
|
|
46
54
|
@process_to_connection_pool[Process.pid] ||= ProxyingConnectionPool.new(@proxy_configuration)
|
|
47
55
|
end
|