good_job 3.13.0 → 3.14.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/app/models/good_job/execution.rb +15 -1
- data/lib/good_job/configuration.rb +4 -0
- data/lib/good_job/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1c0893de944702ad430a2ac00b8e47d740bad60a12a5ae4d009d7c0bcfbeefac
|
4
|
+
data.tar.gz: bdddfd0a48ba4c93c6a255f31a90eee482b1af65b6fd128973235370ab469c01
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3dc31d6cb250ad3fd6494718a282aea4982e0e47f3337d4b0601bb8e46bd958edf84ff6e28fa583c45b4071ca1fc68c0deee0f4a763fb98505ea2d4e65d3547e
|
7
|
+
data.tar.gz: 3937ac0c805118d9ed4c09c7dda525b5dd913190129c2f6bb3bbffe8cc9100716325374d004c86aa6cb623d84a3f5392acea19cbd1bcfbaf0c4585ed9adf7043
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## [v3.14.0](https://github.com/bensheldon/good_job/tree/v3.14.0) (2023-03-09)
|
4
|
+
|
5
|
+
[Full Changelog](https://github.com/bensheldon/good_job/compare/v3.13.0...v3.14.0)
|
6
|
+
|
7
|
+
**Implemented enhancements:**
|
8
|
+
|
9
|
+
- Deprecate definition of job priority, change to "smaller number is higher priority" to align with Active Job definition [\#883](https://github.com/bensheldon/good_job/pull/883) ([bensheldon](https://github.com/bensheldon))
|
10
|
+
|
3
11
|
## [v3.13.0](https://github.com/bensheldon/good_job/tree/v3.13.0) (2023-03-08)
|
4
12
|
|
5
13
|
[Full Changelog](https://github.com/bensheldon/good_job/compare/v3.12.8...v3.13.0)
|
@@ -108,7 +108,13 @@ module GoodJob
|
|
108
108
|
# @!method priority_ordered
|
109
109
|
# @!scope class
|
110
110
|
# @return [ActiveRecord::Relation]
|
111
|
-
scope :priority_ordered,
|
111
|
+
scope :priority_ordered, (lambda do
|
112
|
+
if GoodJob.configuration.smaller_number_is_higher_priority
|
113
|
+
order('priority ASC NULLS LAST')
|
114
|
+
else
|
115
|
+
order('priority DESC NULLS LAST')
|
116
|
+
end
|
117
|
+
end)
|
112
118
|
|
113
119
|
# Order executions by created_at, for first-in first-out
|
114
120
|
# @!method creation_ordered
|
@@ -206,6 +212,14 @@ module GoodJob
|
|
206
212
|
|
207
213
|
# Construct a GoodJob::Execution from an ActiveJob instance.
|
208
214
|
def self.build_for_enqueue(active_job, overrides = {})
|
215
|
+
if active_job.priority && GoodJob.configuration.smaller_number_is_higher_priority.nil?
|
216
|
+
ActiveSupport::Deprecation.warn(<<~DEPRECATION)
|
217
|
+
The next major version of GoodJob (v4.0) will change job `priority` to give smaller numbers higher priority (default: `0`), in accordance with Active Job's definition of priority.
|
218
|
+
To opt-in to this behavior now, set `config.good_job.smaller_number_is_higher_priority = true` in your GoodJob initializer or application.rb.
|
219
|
+
To not opt-in yet, but silence this deprecation warning, set `config.good_job.smaller_number_is_higher_priority = false`.
|
220
|
+
DEPRECATION
|
221
|
+
end
|
222
|
+
|
209
223
|
execution_args = {
|
210
224
|
active_job_id: active_job.job_id,
|
211
225
|
queue_name: active_job.queue_name.presence || DEFAULT_QUEUE_NAME,
|
data/lib/good_job/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: good_job
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.14.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Sheldon
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-03-
|
11
|
+
date: 2023-03-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activejob
|