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: b9e3838deb1306ba70831399e699cd7a2383083f
4
- data.tar.gz: 6bde438d31760d9a5f4ed1e102a2503d75f6f1d5
3
+ metadata.gz: c6a4d0145741bb11280305b63f67838df57b031a
4
+ data.tar.gz: 3e1b862ea6ef4523e2c29195d12ff38414f46d0a
5
5
  SHA512:
6
- metadata.gz: 4bca406e44249df0b1ce4a1ee6ead395885f7dc710c98e8346ecec8c9b516f4599bc5ae0d641c6f48068fcffa0ff008a85ae6052e65dc0614567ac99c09394f8
7
- data.tar.gz: 0d305ea3179b8b057058177bcf6e1440e3d3d392126cca8c1a2fd3bc1baf4b5f5960a1158b0c28defaf2ec5f678c0bc32f2dfad2c240e8afcf1ce2046cb6e87f
6
+ metadata.gz: d035452ac1147e0715590aa5f9353cf93d908d5a98c29b53cca060f2456c1bb6da4efaa5f50565050450e14d09dd6e56cc4c93cb74a1e4cec0dc92300fc01b97
7
+ data.tar.gz: 6f9ee019572a01e107456782319793bee765bf49de341f7b8f432a7a861fc80c58b16be749c4cbfb1f728f4a54abdd04f4f8af70ac91e8c335aab1b0a8a52138
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../
3
3
  specs:
4
- active_replicas (0.2.3)
4
+ active_replicas (0.2.6)
5
5
  concurrent-ruby (~> 1.0)
6
6
 
7
7
  GEM
@@ -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!
@@ -1,3 +1,3 @@
1
1
  module ActiveReplicas
2
- VERSION = "0.2.3"
2
+ VERSION = "0.2.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_replicas
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dirk Gadsden