good_job 3.12.8 → 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 +31 -0
- data/app/filters/good_job/jobs_filter.rb +13 -11
- data/app/models/good_job/execution.rb +15 -1
- data/app/models/good_job/job.rb +10 -0
- data/app/views/good_job/jobs/_table.erb +1 -1
- data/lib/good_job/cli.rb +4 -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,36 @@
|
|
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
|
+
|
11
|
+
## [v3.13.0](https://github.com/bensheldon/good_job/tree/v3.13.0) (2023-03-08)
|
12
|
+
|
13
|
+
[Full Changelog](https://github.com/bensheldon/good_job/compare/v3.12.8...v3.13.0)
|
14
|
+
|
15
|
+
**Implemented enhancements:**
|
16
|
+
|
17
|
+
- If logging to STDOUT in CLI set $stdout.sync = true [\#882](https://github.com/bensheldon/good_job/pull/882) ([blafri](https://github.com/blafri))
|
18
|
+
|
19
|
+
**Fixed bugs:**
|
20
|
+
|
21
|
+
- Don't load all Executions on Jobs Dashboard [\#878](https://github.com/bensheldon/good_job/pull/878) ([bensheldon](https://github.com/bensheldon))
|
22
|
+
|
23
|
+
**Closed issues:**
|
24
|
+
|
25
|
+
- No route matches \[POST\] "/scheduler-dashboard/jobs/\<id\>/retry" [\#880](https://github.com/bensheldon/good_job/issues/880)
|
26
|
+
- What is `concurrency_key` used for? [\#877](https://github.com/bensheldon/good_job/issues/877)
|
27
|
+
- ArgumentError in GoodJob::Jobs\#index [\#875](https://github.com/bensheldon/good_job/issues/875)
|
28
|
+
- Nonworking dashboard for job with many retries [\#809](https://github.com/bensheldon/good_job/issues/809)
|
29
|
+
|
30
|
+
**Merged pull requests:**
|
31
|
+
|
32
|
+
- Add aggressive test for async Batches [\#833](https://github.com/bensheldon/good_job/pull/833) ([bensheldon](https://github.com/bensheldon))
|
33
|
+
|
3
34
|
## [v3.12.8](https://github.com/bensheldon/good_job/tree/v3.12.8) (2023-03-06)
|
4
35
|
|
5
36
|
[Full Changelog](https://github.com/bensheldon/good_job/compare/v3.12.7...v3.12.8)
|
@@ -2,15 +2,17 @@
|
|
2
2
|
module GoodJob
|
3
3
|
class JobsFilter < BaseFilter
|
4
4
|
def states
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
5
|
+
@_states ||= begin
|
6
|
+
query = filtered_query(params.except(:state))
|
7
|
+
{
|
8
|
+
'scheduled' => query.scheduled.count,
|
9
|
+
'retried' => query.retried.count,
|
10
|
+
'queued' => query.queued.count,
|
11
|
+
'running' => query.running.count,
|
12
|
+
'succeeded' => query.succeeded.count,
|
13
|
+
'discarded' => query.discarded.count,
|
14
|
+
}
|
15
|
+
end
|
14
16
|
end
|
15
17
|
|
16
18
|
def filtered_query(filter_params = params)
|
@@ -42,13 +44,13 @@ module GoodJob
|
|
42
44
|
end
|
43
45
|
|
44
46
|
def filtered_count
|
45
|
-
filtered_query.unscope(:select).count
|
47
|
+
@_filtered_count ||= filtered_query.unscope(:select).count
|
46
48
|
end
|
47
49
|
|
48
50
|
private
|
49
51
|
|
50
52
|
def query_for_records
|
51
|
-
filtered_query.
|
53
|
+
filtered_query.includes_advisory_locks
|
52
54
|
end
|
53
55
|
|
54
56
|
def default_base_query
|
@@ -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/app/models/good_job/job.rb
CHANGED
@@ -136,6 +136,16 @@ module GoodJob
|
|
136
136
|
error || executions[-2]&.error
|
137
137
|
end
|
138
138
|
|
139
|
+
# Errors for the job to be displayed in the Dashboard.
|
140
|
+
# @return [String]
|
141
|
+
def display_error
|
142
|
+
return error if error.present?
|
143
|
+
|
144
|
+
serialized_params.fetch('exception_executions', {}).map do |exception, count|
|
145
|
+
"#{exception}: #{count}"
|
146
|
+
end.join(', ')
|
147
|
+
end
|
148
|
+
|
139
149
|
# Return formatted serialized_params for display in the dashboard
|
140
150
|
# @return [Hash]
|
141
151
|
def display_serialized_params
|
@@ -82,7 +82,7 @@
|
|
82
82
|
bs_toggle: "popover",
|
83
83
|
bs_trigger: "hover focus click",
|
84
84
|
bs_placement: "bottom",
|
85
|
-
bs_content: job.
|
85
|
+
bs_content: job.display_error,
|
86
86
|
} %>
|
87
87
|
<% else %>
|
88
88
|
<span class="badge bg-secondary bg-opacity-50 rounded-pill"><%= job.executions_count %></span>
|
data/lib/good_job/cli.rb
CHANGED
@@ -148,7 +148,10 @@ module GoodJob
|
|
148
148
|
# Rails or from the application can be set up here.
|
149
149
|
def set_up_application!
|
150
150
|
require RAILS_ENVIRONMENT_RB
|
151
|
-
return
|
151
|
+
return unless GoodJob::CLI.log_to_stdout?
|
152
|
+
|
153
|
+
$stdout.sync = true
|
154
|
+
return if ActiveSupport::Logger.logger_outputs_to?(GoodJob.logger, $stdout)
|
152
155
|
|
153
156
|
GoodJob::LogSubscriber.loggers << ActiveSupport::TaggedLogging.new(ActiveSupport::Logger.new($stdout))
|
154
157
|
GoodJob::LogSubscriber.reset_logger
|
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
|