switchman 3.5.7 → 3.5.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/switchman/database_server.rb +10 -4
- 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: 88184c7066c4920ceb4b073e35742a8dd4c2b008d2e99ec58c83d17b602f94de
|
4
|
+
data.tar.gz: d9cc2ac7ea0f572d567c06a7afc5b21019ecb05a6bccbe111c606a19011af113
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 523170b15e3509084fcc76fcf8809883e24d4ea40f5b16f09362023c536b847af3a52fd888bb97ed983b0781d07b5e4ca3ad86ee9ee8e1b13b112bbefa4fb3b8
|
7
|
+
data.tar.gz: b2e6328a42baf46c0b4bbc82a0a37cc0e4dcf45d0a51323b21f8cbff005e0d7daf2c90b5a213660bc1c8296022dfcdec284473f8a48aafe8d9393641fd990e4d
|
@@ -268,12 +268,18 @@ module Switchman
|
|
268
268
|
end
|
269
269
|
|
270
270
|
def primary_shard
|
271
|
-
unless
|
271
|
+
return nil unless primary_shard_id
|
272
|
+
|
273
|
+
Shard.lookup(primary_shard_id)
|
274
|
+
end
|
275
|
+
|
276
|
+
def primary_shard_id
|
277
|
+
unless instance_variable_defined?(:@primary_shard_id)
|
272
278
|
# if sharding isn't fully set up yet, we may not be able to query the shards table
|
273
|
-
@
|
274
|
-
@
|
279
|
+
@primary_shard_id = Shard.default.id if Shard.default.database_server == self
|
280
|
+
@primary_shard_id ||= shards.where(name: nil).first&.id
|
275
281
|
end
|
276
|
-
@
|
282
|
+
@primary_shard_id
|
277
283
|
end
|
278
284
|
end
|
279
285
|
end
|
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.5.
|
4
|
+
version: 3.5.8
|
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: 2023-07
|
13
|
+
date: 2023-08-07 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activerecord
|