switchman 3.0.23 → 3.0.24
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/switchman/active_record/base.rb +4 -4
- data/lib/switchman/database_server.rb +1 -1
- data/lib/switchman/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 469ef6bca62776e9ba974a5c6d2a6220fc6ddcf1649956f43247465cbfb24f37
|
|
4
|
+
data.tar.gz: 9fefef5095835cf28a6c72197ed74f6de9974d7c9c9019ad4ea87209d98c37e9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 96d01726ff4e0e560e63964c5607417b7272202109b6e7e718769e9ba2cc04f82000f442c70aef8d6140e6dac00925197f0a95c70b790d47fbc2355d9021ae39
|
|
7
|
+
data.tar.gz: 4b2edb3c0400f3280ba579bfaac61fce263ea5dd0881e5eeb77e675e0d2c1dfe04168e059f7bb91ac601ce2ef210c50c252945258fe2166ee6cf21c458defac0
|
|
@@ -58,8 +58,8 @@ module Switchman
|
|
|
58
58
|
end
|
|
59
59
|
end
|
|
60
60
|
|
|
61
|
-
def
|
|
62
|
-
current_role != current_role(without_overrides: true)
|
|
61
|
+
def role_overriden?(shard_id)
|
|
62
|
+
current_role(target_shard: shard_id) != current_role(without_overrides: true)
|
|
63
63
|
end
|
|
64
64
|
|
|
65
65
|
def establish_connection(config_or_env = nil)
|
|
@@ -86,12 +86,12 @@ module Switchman
|
|
|
86
86
|
end
|
|
87
87
|
|
|
88
88
|
# significant change: Allow per-shard roles
|
|
89
|
-
def current_role(without_overrides: false)
|
|
89
|
+
def current_role(without_overrides: false, target_shard: current_shard)
|
|
90
90
|
return super() if without_overrides
|
|
91
91
|
|
|
92
92
|
sharded_role = nil
|
|
93
93
|
connected_to_stack.reverse_each do |hash|
|
|
94
|
-
shard_role = hash.dig(:shard_roles,
|
|
94
|
+
shard_role = hash.dig(:shard_roles, target_shard)
|
|
95
95
|
if shard_role && (hash[:klasses].include?(::ActiveRecord::Base) || hash[:klasses].include?(connection_classes))
|
|
96
96
|
sharded_role = shard_role
|
|
97
97
|
break
|
data/lib/switchman/version.rb
CHANGED
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: 3.0.
|
|
4
|
+
version: 3.0.24
|
|
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: 2022-04-
|
|
13
|
+
date: 2022-04-28 00:00:00.000000000 Z
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|
|
16
16
|
name: activerecord
|