rocketjob 5.4.0.beta2 → 5.4.0
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/rocket_job/plugins/job/throttle_running_jobs.rb +6 -2
- data/lib/rocket_job/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0bf1e6e7eb0a44011830a99c689c56768857d8de4c4e2c95e6b536feb6f63aab
|
4
|
+
data.tar.gz: '0172629dc33a08bfbd976599b619a41495680124dcd7df9a08e61308f0d043b4'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6ac52c54834a7370dfdb9e7460ca1818c19b91beb2afc875ba0edab63a9b0d9480bc704a35bd155825f3c0b280efea9a406783212e8621fcbf6b046b8af62e78
|
7
|
+
data.tar.gz: f044d85630a0b6b36b07f7092ec18ac452d608cb9c7dbb7d26235493c51df584d7479190b24dfd1805ba7a086c8188e48ab8b02590d0748d013c6fb462b01505
|
@@ -29,6 +29,9 @@ module RocketJob
|
|
29
29
|
class_attribute :throttle_running_jobs
|
30
30
|
self.throttle_running_jobs = nil
|
31
31
|
|
32
|
+
# Allow jobs to be throttled by group name instance of the job class name.
|
33
|
+
field :throttle_group, type: String, class_attribute: true, user_editable: true, copy_on_restart: true
|
34
|
+
|
32
35
|
define_throttle :throttle_running_jobs_exceeded?
|
33
36
|
end
|
34
37
|
|
@@ -38,9 +41,10 @@ module RocketJob
|
|
38
41
|
def throttle_running_jobs_exceeded?
|
39
42
|
return unless throttle_running_jobs&.positive?
|
40
43
|
|
41
|
-
# Cannot use this class since it will include instances of parent job classes.
|
42
44
|
RocketJob::Job.with(read: {mode: :primary}) do |conn|
|
43
|
-
|
45
|
+
query = {:id.ne => id}
|
46
|
+
throttle_group ? query["throttle_group"] = throttle_group : query["_type"] = self.class.name
|
47
|
+
conn.running.where(query).count >= throttle_running_jobs
|
44
48
|
end
|
45
49
|
end
|
46
50
|
end
|
data/lib/rocket_job/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rocketjob
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.4.0
|
4
|
+
version: 5.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Reid Morrison
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-12-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aasm
|
@@ -220,12 +220,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
220
220
|
requirements:
|
221
221
|
- - ">="
|
222
222
|
- !ruby/object:Gem::Version
|
223
|
-
version: '2.
|
223
|
+
version: '2.5'
|
224
224
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
225
225
|
requirements:
|
226
|
-
- - "
|
226
|
+
- - ">="
|
227
227
|
- !ruby/object:Gem::Version
|
228
|
-
version:
|
228
|
+
version: '0'
|
229
229
|
requirements: []
|
230
230
|
rubygems_version: 3.0.8
|
231
231
|
signing_key:
|