switchman 4.3.4 → 4.3.5
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/shard.rb +2 -2
- data/lib/switchman/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 756e8de301a68ac11f33a55bf4686cfa5deb9ff15f40b8750a9ec9ade881e136
|
|
4
|
+
data.tar.gz: 347370745f986e5b63bcc2c11c8855d5ca1a9c08d79e0f8b66d60552b0cbaa1b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6f50f01e9566f118a4bbc89a4aa30fabc8ed00d34fc020c84856ab5c027aa912b57462c7a5658f7b330eaed4308d121703266f441b9b1e451dcf4a2bf3e8ee3e
|
|
7
|
+
data.tar.gz: 3146ef11b0fa04471c63c0bc74bb4344d15fc08a833bfbd878a5be82cfd024a2f6c2516bef2961e8032164f16db367c2b96aaf421032d2b7e10b4a3e599b00eb
|
data/lib/switchman/shard.rb
CHANGED
|
@@ -154,12 +154,12 @@ module Switchman
|
|
|
154
154
|
missing = shard_ids - cached_shards.keys
|
|
155
155
|
return if missing.empty?
|
|
156
156
|
|
|
157
|
-
found = where(id: missing).index_by(&:id)
|
|
157
|
+
found = where(id: missing).select(&:database_server).index_by(&:id) # exclude shards w/o database servers
|
|
158
158
|
missing.each { |id| found[id] = nil unless found.key?(id) } # cache nonexistence of shards
|
|
159
159
|
cached_shards.reverse_merge!(found)
|
|
160
160
|
else
|
|
161
161
|
cached_shards.reverse_merge!(active_shards.values.index_by(&:id))
|
|
162
|
-
cached_shards.reverse_merge!(all.index_by(&:id))
|
|
162
|
+
cached_shards.reverse_merge!(all.select(&:database_server).index_by(&:id))
|
|
163
163
|
end
|
|
164
164
|
end
|
|
165
165
|
|
data/lib/switchman/version.rb
CHANGED