switchman-inst-jobs 1.1.5 → 1.1.6

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: 3dd65faa434868517f859fd3b90d582a671f2dc7e1275370ae133b5151748527
4
- data.tar.gz: d0841caa3c278cc58faa39c0b0f356951c6eb0fc22d28ce1b2bb941b01ef2ad3
3
+ metadata.gz: 9b7a83e74af17d230439d800f055105f76b96122315e514cd30df09c2d5f9e9b
4
+ data.tar.gz: bf2994748331624df6136f1d8098b579515b851f6b657720af9d4f4c822ce531
5
5
  SHA512:
6
- metadata.gz: c9684c4c11cac2524251096d72870a293e0884a1d622083901a39528842f5e62d18c02d4a45b69130c02a1365ce978f8079056b76c8d63bf76a24d5dc6427ec0
7
- data.tar.gz: b632c0038b97184d696254966de81436441c862ee69729102091b854315145d07be4b6ca8e8269afc5cd61cf901cf3efd7e65853d6c36caf3bb83f4b754546b4
6
+ metadata.gz: 2918f1e04b365d854c4604f5b59d1aa25015a32758ef32e1dc8d3bb6593ac5e6f6cbd932f6c25066b65a40d6e412c4ed205f1fffa363cf1128324d7f3cb27857
7
+ data.tar.gz: cd5a1ebd2e501a59b7f3d3ba410771922b004e2c5e1842b649603c3fd147ad27918987b33440427cd8bd152a9c571eea5143d926a6dd60be0aa335f11733cc38
@@ -25,6 +25,22 @@ module SwitchmanInstJobs
25
25
  super(object, enqueue_options)
26
26
  end
27
27
  end
28
+
29
+ def configured_shard_ids
30
+ (::Delayed::Settings.worker_config.try(:[], "workers") || []).map{|w| w["shard"]}.compact.uniq
31
+ end
32
+
33
+ def processes_running_locally
34
+ shard_ids = configured_shard_ids
35
+ if shard_ids.any?
36
+ shards = shard_ids.map { |shard_id| ::Delayed::Worker.shard(shard_id) }
37
+ ::Switchman::Shard.with_each_shard(shards, [:delayed_jobs]) do
38
+ super
39
+ end
40
+ else
41
+ super
42
+ end
43
+ end
28
44
  end
29
45
 
30
46
  def self.prepended(base)
@@ -1,3 +1,3 @@
1
1
  module SwitchmanInstJobs
2
- VERSION = '1.1.5'.freeze
2
+ VERSION = '1.1.6'.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.1.5
4
+ version: 1.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bryan Petty
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-05-17 00:00:00.000000000 Z
11
+ date: 2018-06-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: inst-jobs
@@ -267,7 +267,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
267
267
  version: '0'
268
268
  requirements: []
269
269
  rubyforge_project:
270
- rubygems_version: 2.7.6
270
+ rubygems_version: 2.7.3
271
271
  signing_key:
272
272
  specification_version: 4
273
273
  summary: Switchman and Instructure Jobs compatibility gem.