switchman-inst-jobs 1.3.6 → 1.3.7

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
2
  SHA256:
3
- metadata.gz: e39492734082a2e3a5f6a7056fcf6bef4ebda5952cbd9188de8fc8ae0e938630
4
- data.tar.gz: f6dfdaf0c045612ac8af1cba019e01b9cd9a5ad75164f8dacd03fd030d0884a3
3
+ metadata.gz: 2bab0c63ffbb0a328830881dd3a7c4d87dcf4d257924540e3f817987cc0b02ca
4
+ data.tar.gz: 4efc1a1f73cd1c4e3343ebabb4aee21ce8b974b7191052616d6e1266e1547875
5
5
  SHA512:
6
- metadata.gz: 852061f2038fc91038289fe3fa2ce9a9b69cdc54e6aaa0aba403fed22ba1d9bd9b62da1215805bb6b598a3d5f9fa43b48748dde828c6ce60c62587952fb7d024
7
- data.tar.gz: 40d8fa1ff7e15c54e4ad5c3ce967759d707c7eb8be9da70894768ae3d46aa93d4133003bdf95aa563c1a6baf9dfdf46ccdf8e642c9b6f7592ec5058775c5e87d
6
+ metadata.gz: 79109e3f82d473756cdb953c78b5e062c6f5bd4f262356c86c4502abe5aebff40a45679dea2ec530552d23b104fd70ab3f75f7686587d0da75c28ff97bc963fe
7
+ data.tar.gz: 39dda681ada80591021c3ca33df1061ae62307d94870fd6e4f5193cc361a4353a4b74f7ac86e0a4ab8bfd1fa4f4e800ac7556bbc6d4572b3ea314b5f4b551bf9
@@ -60,12 +60,7 @@ module SwitchmanInstJobs
60
60
  def delayed_jobs_shards
61
61
  unless instance_variable_defined?(:@delayed_jobs_shards)
62
62
  # re-entrancy protection
63
- @delayed_jobs_shards = []
64
63
  @delayed_jobs_shards = begin
65
- db_dj_shards = ::Switchman::DatabaseServer.all.map do |db|
66
- next db.shards.to_a if db.config[:delayed_jobs_shard] == 'self'
67
- db.delayed_jobs_shard
68
- end.compact.flatten.uniq # yes, all three
69
64
  shard_dj_shards = [] unless ::Switchman::Shard.columns_hash.key?('delayed_jobs_shard_id')
70
65
  shard_dj_shards ||= begin
71
66
  ::Switchman::Shard
@@ -75,6 +70,15 @@ module SwitchmanInstJobs
75
70
  .map { |id| ::Switchman::Shard.lookup(id) }
76
71
  .compact
77
72
  end
73
+ # set it temporarily, to avoid the default shard falling back to itself
74
+ # if other shards are usable
75
+ @delayed_jobs_shards = shard_dj_shards.uniq.sort
76
+
77
+ db_dj_shards = ::Switchman::DatabaseServer.all.map do |db|
78
+ next db.shards.to_a if db.config[:delayed_jobs_shard] == 'self'
79
+ db.delayed_jobs_shard
80
+ end.compact.flatten.uniq # yes, all three
81
+
78
82
  (db_dj_shards + shard_dj_shards).uniq.sort
79
83
  end
80
84
  end
@@ -1,3 +1,3 @@
1
1
  module SwitchmanInstJobs
2
- VERSION = '1.3.6'.freeze
2
+ VERSION = '1.3.7'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: switchman-inst-jobs
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.6
4
+ version: 1.3.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bryan Petty
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-10-31 00:00:00.000000000 Z
11
+ date: 2019-11-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: inst-jobs