good_job 3.4.4 → 3.4.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +18 -1
- data/README.md +7 -7
- data/app/assets/good_job/style.css +0 -5
- data/app/models/good_job/execution.rb +8 -1
- data/app/views/good_job/jobs/_table.erb +1 -0
- data/app/views/good_job/shared/_filter.erb +3 -0
- data/config/locales/en.yml +0 -1
- data/config/locales/es.yml +0 -1
- data/config/locales/nl.yml +0 -1
- data/config/locales/ru.yml +0 -1
- data/lib/good_job/adapter.rb +1 -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: 844b8a9661a1a6eefe86a2e58d829405b92bc7b54ad51ba6aeafea22c11ca080
|
4
|
+
data.tar.gz: c09eab3a34fe0ba218d79c0576bc1d9fe8cb41182c6d2bbf0af28c9bbbd4ce9a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9d492d0763ab41e64f3670bc15176f6eec58d4fea9b4be7aa850cb2eaff4dba56d94ce42c6b0d123046dc2f0f2d183ad69e1fe6792b3e0b7fc077a32fecdff78
|
7
|
+
data.tar.gz: bb956e43b86d88a4492d715ddef00710d5667d6aed2a33b9fe9c532cfb1515f74a03e8bc7d7b86b4655296ed5ab22ad8813d9794c281304f1672853364928d1e
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,23 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## [v3.4.5](https://github.com/bensheldon/good_job/tree/v3.4.5) (2022-09-12)
|
4
|
+
|
5
|
+
[Full Changelog](https://github.com/bensheldon/good_job/compare/v3.4.4...v3.4.5)
|
6
|
+
|
7
|
+
**Fixed bugs:**
|
8
|
+
|
9
|
+
- Dashboard: Remove translation\_missing red highlighting; remove number\_to\_human.hundreds; add form labels [\#708](https://github.com/bensheldon/good_job/pull/708) ([bensheldon](https://github.com/bensheldon))
|
10
|
+
|
11
|
+
**Closed issues:**
|
12
|
+
|
13
|
+
- pg\_xact No Such File error in logs [\#709](https://github.com/bensheldon/good_job/issues/709)
|
14
|
+
- Broken upgrade to v3. [\#703](https://github.com/bensheldon/good_job/issues/703)
|
15
|
+
|
16
|
+
**Merged pull requests:**
|
17
|
+
|
18
|
+
- Sentry integration Docs [\#711](https://github.com/bensheldon/good_job/pull/711) ([remy727](https://github.com/remy727))
|
19
|
+
- Add an `Execution` `after_perform_unlocked` callback [\#706](https://github.com/bensheldon/good_job/pull/706) ([bensheldon](https://github.com/bensheldon))
|
20
|
+
|
3
21
|
## [v3.4.4](https://github.com/bensheldon/good_job/tree/v3.4.4) (2022-08-20)
|
4
22
|
|
5
23
|
[Full Changelog](https://github.com/bensheldon/good_job/compare/v3.4.3...v3.4.4)
|
@@ -138,7 +156,6 @@
|
|
138
156
|
|
139
157
|
**Closed issues:**
|
140
158
|
|
141
|
-
- Unable to Replace GoodJob's Logger [\#667](https://github.com/bensheldon/good_job/issues/667)
|
142
159
|
- Readme should consistently encourage usage of `config.good_job....` instead of `GoodJob.` configuration [\#628](https://github.com/bensheldon/good_job/issues/628)
|
143
160
|
- Improve the "Gem development" section of README? [\#551](https://github.com/bensheldon/good_job/issues/551)
|
144
161
|
- Simplify Rails initialization to only be a mountable Engine [\#543](https://github.com/bensheldon/good_job/issues/543)
|
data/README.md
CHANGED
@@ -232,7 +232,7 @@ Rails.application.configure do
|
|
232
232
|
# Configure options individually...
|
233
233
|
config.good_job.preserve_job_records = true
|
234
234
|
config.good_job.retry_on_unhandled_error = false
|
235
|
-
config.good_job.on_thread_error = -> (exception) {
|
235
|
+
config.good_job.on_thread_error = -> (exception) { Sentry.capture_exception(exception) }
|
236
236
|
config.good_job.execution_mode = :async
|
237
237
|
config.good_job.queues = '*'
|
238
238
|
config.good_job.max_threads = 5
|
@@ -245,7 +245,7 @@ Rails.application.configure do
|
|
245
245
|
config.good_job = {
|
246
246
|
preserve_job_records: true,
|
247
247
|
retry_on_unhandled_error: false,
|
248
|
-
on_thread_error: -> (exception) {
|
248
|
+
on_thread_error: -> (exception) { Sentry.capture_exception(exception) },
|
249
249
|
execution_mode: :async,
|
250
250
|
queues: '*',
|
251
251
|
max_threads: 5,
|
@@ -287,7 +287,7 @@ Available configuration options are:
|
|
287
287
|
- `on_thread_error` (proc, lambda, or callable) will be called when an Exception. It can be useful for logging errors to bug tracking services, like Sentry or Airbrake. Example:
|
288
288
|
|
289
289
|
```ruby
|
290
|
-
config.good_job.on_thread_error = -> (exception) {
|
290
|
+
config.good_job.on_thread_error = -> (exception) { Sentry.capture_exception(exception) }
|
291
291
|
```
|
292
292
|
|
293
293
|
By default, GoodJob configures the following execution modes per environment:
|
@@ -567,7 +567,7 @@ If errors do reach GoodJob, you can assign a callable to `GoodJob.on_thread_erro
|
|
567
567
|
|
568
568
|
```ruby
|
569
569
|
# config/initializers/good_job.rb
|
570
|
-
GoodJob.on_thread_error = -> (exception) {
|
570
|
+
GoodJob.on_thread_error = -> (exception) { Sentry.capture_exception(exception) }
|
571
571
|
```
|
572
572
|
|
573
573
|
#### Retries
|
@@ -601,13 +601,13 @@ class ApplicationJob < ActiveJob::Base
|
|
601
601
|
retry_on StandardError, wait: :exponentially_longer, attempts: Float::INFINITY
|
602
602
|
|
603
603
|
retry_on SpecialError, attempts: 5 do |_job, exception|
|
604
|
-
|
604
|
+
Sentry.capture_exception(exception)
|
605
605
|
end
|
606
606
|
|
607
607
|
around_perform do |_job, block|
|
608
608
|
block.call
|
609
609
|
rescue StandardError => e
|
610
|
-
|
610
|
+
Sentry.capture_exception(e)
|
611
611
|
raise
|
612
612
|
end
|
613
613
|
# ...
|
@@ -630,7 +630,7 @@ ActionMailer::MailDeliveryJob.retry_on StandardError, wait: :exponentially_longe
|
|
630
630
|
ActionMailer::MailDeliveryJob.around_perform do |_job, block|
|
631
631
|
block.call
|
632
632
|
rescue StandardError => e
|
633
|
-
|
633
|
+
Sentry.capture_exception(e)
|
634
634
|
raise
|
635
635
|
end
|
636
636
|
```
|
@@ -20,6 +20,8 @@ module GoodJob
|
|
20
20
|
self.table_name = 'good_jobs'
|
21
21
|
self.advisory_lockable_column = 'active_job_id'
|
22
22
|
|
23
|
+
define_model_callbacks :perform_unlocked, only: :after
|
24
|
+
|
23
25
|
# Parse a string representing a group of queues into a more readable data
|
24
26
|
# structure.
|
25
27
|
# @param string [String] Queue string
|
@@ -202,13 +204,18 @@ module GoodJob
|
|
202
204
|
# raised, if any (if the job raised, then the second array entry will be
|
203
205
|
# +nil+). If there were no jobs to execute, returns +nil+.
|
204
206
|
def self.perform_with_advisory_lock(parsed_queues: nil)
|
207
|
+
execution = nil
|
208
|
+
result = nil
|
205
209
|
unfinished.dequeueing_ordered(parsed_queues).only_scheduled.limit(1).with_advisory_lock(unlock_session: true) do |executions|
|
206
210
|
execution = executions.first
|
207
211
|
break if execution.blank?
|
208
212
|
break :unlocked unless execution&.executable?
|
209
213
|
|
210
|
-
execution.perform
|
214
|
+
result = execution.perform
|
211
215
|
end
|
216
|
+
execution&.run_callbacks(:perform_unlocked)
|
217
|
+
|
218
|
+
result
|
212
219
|
end
|
213
220
|
|
214
221
|
# Fetches the scheduled execution time of the next eligible Execution(s).
|
@@ -4,6 +4,7 @@
|
|
4
4
|
<header class="list-group-item bg-light">
|
5
5
|
<div class="row small text-muted text-uppercase align-items-center">
|
6
6
|
<div class="col-auto">
|
7
|
+
<%= label_tag('toggle_job_ids', "Toggle all jobs", class: "visually-hidden") %>
|
7
8
|
<%= check_box_tag('toggle_job_ids', "1", false, data: { "checkbox-toggle-all": "job_ids" }) %>
|
8
9
|
</div>
|
9
10
|
<div class="col-4">
|
@@ -8,6 +8,7 @@
|
|
8
8
|
<%= hidden_field_tag :locale, params[:locale] if params[:locale] %>
|
9
9
|
<div class="d-flex flex-row w-100">
|
10
10
|
<div class="me-2">
|
11
|
+
<%= label_tag "job_queue_filter", "Queue name", class: "visually-hidden" %>
|
11
12
|
<select name="queue_name" id="job_queue_filter" class="form-select form-select-sm">
|
12
13
|
<option value="" <%= "selected='selected'" if params[:queue_name].blank? %>>All queues</option>
|
13
14
|
|
@@ -18,6 +19,7 @@
|
|
18
19
|
</div>
|
19
20
|
|
20
21
|
<div class="me-2">
|
22
|
+
<%= label_tag "job_class_filter", "Job name", class: "visually-hidden" %>
|
21
23
|
<select name="job_class" id="job_class_filter" class="form-select form-select-sm">
|
22
24
|
<option value="" <%= "selected='selected'" if params[:job_class].blank? %>>All jobs</option>
|
23
25
|
|
@@ -28,6 +30,7 @@
|
|
28
30
|
</div>
|
29
31
|
|
30
32
|
<div class="me-2 flex-fill">
|
33
|
+
<%= label_tag "query", "Search", class: "visually-hidden" %>
|
31
34
|
<%= search_field_tag "query", params[:query], class: "form-control form-control-sm", placeholder: "Search by class, job id, job params, and error text." %>
|
32
35
|
</div>
|
33
36
|
|
data/config/locales/en.yml
CHANGED
data/config/locales/es.yml
CHANGED
data/config/locales/nl.yml
CHANGED
data/config/locales/ru.yml
CHANGED
data/lib/good_job/adapter.rb
CHANGED
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.
|
4
|
+
version: 3.4.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Sheldon
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-09-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activejob
|