rocketjob 5.4.0 → 5.4.1
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 97910a2bbdcc67b808677e01f9ef9650935deac9f47ee415ad7665227e06e2a3
|
4
|
+
data.tar.gz: 9c560b2a1deea93eb4c8e9cdf6fb28f2308e8f9a85457660c292ad38a2b76137
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 768538825ba34f58d915205fb1c61066ef2d86d9c3743f487db381074e30bd75c420f99f017adbb338c0dd4f202a69cf699b0b4e2a9ebc0581423fb102c85284
|
7
|
+
data.tar.gz: 17d494818bf341a6b3340f4c0c5d5b77ec68c05eeb26d10eccb43c81221c14acd64ffe73ea1f610b514f233c84d5cc7cf3c2a10f4d1410b9b427308d22f5ad53
|
@@ -47,24 +47,19 @@ module RocketJob
|
|
47
47
|
|
48
48
|
# Returns [Boolean] whether the throttle for this job has been exceeded
|
49
49
|
def throttle_running_workers_exceeded?(slice)
|
50
|
-
return unless throttle_running_workers&.positive?
|
50
|
+
return false unless throttle_running_workers&.positive?
|
51
51
|
|
52
52
|
input.running.with(read: {mode: :primary}) do |conn|
|
53
53
|
conn.where(:id.ne => slice.id).count >= throttle_running_workers
|
54
54
|
end
|
55
55
|
end
|
56
56
|
|
57
|
-
#
|
58
|
-
#
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
# Cannot use this class since it will include instances of parent job classes.
|
65
|
-
RocketJob::Job.with(read: {mode: :primary}) do |conn|
|
66
|
-
conn.running.where("_type" => self.class.name, :id.ne => id, :priority.lte => priority).count >= throttle_running_jobs
|
67
|
-
end
|
57
|
+
# Allows another job with a higher priority to start even though this one is running already
|
58
|
+
# @overrides RocketJob::Plugins::Job::ThrottleRunningJobs#throttle_running_jobs_base_query
|
59
|
+
def throttle_running_jobs_base_query
|
60
|
+
query = super
|
61
|
+
query[:priority.lte] = priority if throttle_running_workers&.positive?
|
62
|
+
query
|
68
63
|
end
|
69
64
|
end
|
70
65
|
end
|
@@ -39,14 +39,18 @@ module RocketJob
|
|
39
39
|
|
40
40
|
# Returns [Boolean] whether the throttle for this job has been exceeded
|
41
41
|
def throttle_running_jobs_exceeded?
|
42
|
-
return unless throttle_running_jobs&.positive?
|
42
|
+
return false unless throttle_running_jobs&.positive?
|
43
43
|
|
44
44
|
RocketJob::Job.with(read: {mode: :primary}) do |conn|
|
45
|
-
query =
|
45
|
+
query = throttle_running_jobs_base_query
|
46
46
|
throttle_group ? query["throttle_group"] = throttle_group : query["_type"] = self.class.name
|
47
47
|
conn.running.where(query).count >= throttle_running_jobs
|
48
48
|
end
|
49
49
|
end
|
50
|
+
|
51
|
+
def throttle_running_jobs_base_query
|
52
|
+
{:id.ne => id}
|
53
|
+
end
|
50
54
|
end
|
51
55
|
end
|
52
56
|
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.
|
4
|
+
version: 5.4.1
|
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-12-
|
11
|
+
date: 2020-12-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aasm
|