switchman 1.11.4 → 1.11.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
- SHA1:
3
- metadata.gz: b40589b2796070b5a55edbfaa06e7ee2dcd05478
4
- data.tar.gz: e33d1ff82c83ff078eec77c931ce42c89717d6d9
2
+ SHA256:
3
+ metadata.gz: 6083a58473cad8269f0d2661c15708a904613b3d757dd2de0585e4ef404fc0e1
4
+ data.tar.gz: 9a42fb4e9ace95194e0c1557fd717379e9a14de7d19ffd106d6ab5ec038c1a90
5
5
  SHA512:
6
- metadata.gz: 63bba2a4886b48a1d3946b0a3d5151d1d757e319d6fd57dc7c62d81e93d111ea039ffc0d8822a75ce8d0b9f34878b5bb78b4fae830d5a9c2062768bca2c3c6ce
7
- data.tar.gz: a4182eae2a0514579a70bcab1a55d566265d1b5bc6a14e1b9f08b0dc71c82b52110beb7b1b41c5236e87f9da5dd16a629b0f08d0d4d08f2ed45e58d8d96a6ac5
6
+ metadata.gz: 4ee490b1bc3a156aee2c7d8ba458a29a160e35172d4cc19b1529b48c6ffb6a87a436241d2b970617e243af1a0eb626d99d71ad9425da12dd1c649d102c521b95
7
+ data.tar.gz: 24ccd7ef87aaed9533045258087c6c25fc23ecc5861248a9c8bad047355d97c1110ca4f3dccf860160d7f4417316850f4429af214b32ca70f849dab49f5996ee
@@ -43,7 +43,7 @@ module Switchman
43
43
  end
44
44
 
45
45
  def connections
46
- @connection_pools.values.map(&:connections).inject([], &:+)
46
+ connection_pools.map(&:connections).inject([], &:+)
47
47
  end
48
48
 
49
49
  def connection
@@ -77,23 +77,27 @@ module Switchman
77
77
  clear_stale_cached_connections!
78
78
  enable_query_cache!
79
79
  disable_query_cache! }.each do |method|
80
- class_eval(<<-EOS)
80
+ class_eval(<<-RUBY, __FILE__, __LINE__ + 1)
81
81
  def #{method}
82
- @connection_pools.values.each(&:#{method})
82
+ connection_pools.each(&:#{method})
83
83
  end
84
- EOS
84
+ RUBY
85
85
  end
86
86
 
87
87
  def automatic_reconnect=(value)
88
- @connection_pools.values.each { |pool| pool.automatic_reconnect = value }
88
+ connection_pools.each { |pool| pool.automatic_reconnect = value }
89
89
  end
90
90
 
91
91
  def clear_idle_connections!(since_when)
92
- @connection_pools.values.each { |pool| pool.clear_idle_connections!(since_when) }
92
+ connection_pools.each { |pool| pool.clear_idle_connections!(since_when) }
93
93
  end
94
94
 
95
95
  protected
96
96
 
97
+ def connection_pools
98
+ (@connection_pools.values + [default_pool]).uniq
99
+ end
100
+
97
101
  def pool_key
98
102
  [active_shackles_environment,
99
103
  active_shard.database_server.shareable? ? active_shard.database_server.pool_key : active_shard]
@@ -1,3 +1,3 @@
1
1
  module Switchman
2
- VERSION = "1.11.4"
2
+ VERSION = "1.11.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: switchman
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.11.4
4
+ version: 1.11.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cody Cutrer
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2017-09-28 00:00:00.000000000 Z
13
+ date: 2018-01-23 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: railties
@@ -177,7 +177,6 @@ files:
177
177
  - db/migrate/20130328212039_create_switchman_shards.rb
178
178
  - db/migrate/20130328224244_create_default_shard.rb
179
179
  - db/migrate/20161206323434_add_back_default_string_limits_switchman.rb
180
- - db/shard_1708.sqlite3
181
180
  - lib/switchman.rb
182
181
  - lib/switchman/action_controller/caching.rb
183
182
  - lib/switchman/active_record/abstract_adapter.rb
@@ -244,7 +243,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
244
243
  version: '0'
245
244
  requirements: []
246
245
  rubyforge_project:
247
- rubygems_version: 2.6.10
246
+ rubygems_version: 2.7.3
248
247
  signing_key:
249
248
  specification_version: 4
250
249
  summary: Rails 4 sharding magic
File without changes