good_job 3.12.8 → 3.13.0

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: 92bd0503979e96fb9119be0be1afd74b7be8594a3c377026c06ea55dcb26a3ee
4
- data.tar.gz: fedebf29ee5a4100414367687958e6c8cfcc1bce938618344466bf86e454aacc
3
+ metadata.gz: c83cf253d12daeb00363fe9c1b3a06b463c6944aa108aa4f884bf43b0d1f5c88
4
+ data.tar.gz: 71738f01485fb73b1dfa71396807f4570922d53aa186bf7aa1f9c27b21e4e559
5
5
  SHA512:
6
- metadata.gz: 3eb60ccb026da7584b87968cd89bf1df4fc763c208271d4cde46c3c831ac8887cec7eb10f607ebfb57d1c790ec0529683fb578f6bf094809d0fc43ebaf8c3c06
7
- data.tar.gz: 425dd0a42e51c79710589948c0b99e9a148e31d524265772c4e931c9b610a7fa2bc0de0123ca8038afab42abf85e22f9083f76a151837608f0e07327aef8796a
6
+ metadata.gz: 25bbd078a94d5079b47d57c267ad72f7e6baa024230add7fd9c693c621eb8be7117aa517f715baba5b16cb5f0378eb0e407a41ea1569e923a16716ef0f4d391b
7
+ data.tar.gz: cf58cbaea01a1dd6714b53c6d618661908ccf46ef3deae58b3e2d6063f512e528d0d4f04850e7a3c4a1ccc59ece959a0919d19898488116898f78b9c78c7a5f6
data/CHANGELOG.md CHANGED
@@ -1,5 +1,28 @@
1
1
  # Changelog
2
2
 
3
+ ## [v3.13.0](https://github.com/bensheldon/good_job/tree/v3.13.0) (2023-03-08)
4
+
5
+ [Full Changelog](https://github.com/bensheldon/good_job/compare/v3.12.8...v3.13.0)
6
+
7
+ **Implemented enhancements:**
8
+
9
+ - If logging to STDOUT in CLI set $stdout.sync = true [\#882](https://github.com/bensheldon/good_job/pull/882) ([blafri](https://github.com/blafri))
10
+
11
+ **Fixed bugs:**
12
+
13
+ - Don't load all Executions on Jobs Dashboard [\#878](https://github.com/bensheldon/good_job/pull/878) ([bensheldon](https://github.com/bensheldon))
14
+
15
+ **Closed issues:**
16
+
17
+ - No route matches \[POST\] "/scheduler-dashboard/jobs/\<id\>/retry" [\#880](https://github.com/bensheldon/good_job/issues/880)
18
+ - What is `concurrency_key` used for? [\#877](https://github.com/bensheldon/good_job/issues/877)
19
+ - ArgumentError in GoodJob::Jobs\#index [\#875](https://github.com/bensheldon/good_job/issues/875)
20
+ - Nonworking dashboard for job with many retries [\#809](https://github.com/bensheldon/good_job/issues/809)
21
+
22
+ **Merged pull requests:**
23
+
24
+ - Add aggressive test for async Batches [\#833](https://github.com/bensheldon/good_job/pull/833) ([bensheldon](https://github.com/bensheldon))
25
+
3
26
  ## [v3.12.8](https://github.com/bensheldon/good_job/tree/v3.12.8) (2023-03-06)
4
27
 
5
28
  [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
- query = filtered_query(params.except(:state))
6
- {
7
- 'scheduled' => query.scheduled.count,
8
- 'retried' => query.retried.count,
9
- 'queued' => query.queued.count,
10
- 'running' => query.running.count,
11
- 'succeeded' => query.succeeded.count,
12
- 'discarded' => query.discarded.count,
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.includes(:executions).includes_advisory_locks
53
+ filtered_query.includes_advisory_locks
52
54
  end
53
55
 
54
56
  def default_base_query
@@ -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.recent_error
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 if !GoodJob::CLI.log_to_stdout? || ActiveSupport::Logger.logger_outputs_to?(GoodJob.logger, $stdout)
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
  module GoodJob
3
3
  # GoodJob gem version.
4
- VERSION = '3.12.8'
4
+ VERSION = '3.13.0'
5
5
  end
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.12.8
4
+ version: 3.13.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-06 00:00:00.000000000 Z
11
+ date: 2023-03-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activejob