good_job 3.26.0 → 3.26.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +12 -0
- data/app/controllers/good_job/jobs_controller.rb +7 -1
- data/app/models/good_job/base_execution.rb +3 -1
- data/app/models/good_job/job.rb +4 -1
- data/lib/good_job/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eedb4c5defcfa2e25d62147f5021bb868ee0a93b74ae680c46ea4e852212d0dc
|
4
|
+
data.tar.gz: d0124daaa3d93e7ace5b0764031c44cc06b03559286ebf1e5a36936e414bb50d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 15c9fbd5228a60caa7a1d13ec9e6165c1a78ea488a9e7dd992cf60339dfb9523ca8cc68efa0588dddf16f491bf065a878837d943355a7bcae8ba80ec998615d4
|
7
|
+
data.tar.gz: aea808fb1eb1ce99c9de4b15c429dc8128d7eee29445a1ca5172498d9f919f8596f28416e2967c41d4bcb6e389e098db90f865e9dce1870229131aaa28212930
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,17 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## [v3.26.1](https://github.com/bensheldon/good_job/tree/v3.26.1) (2024-03-01)
|
4
|
+
|
5
|
+
[Full Changelog](https://github.com/bensheldon/good_job/compare/v3.26.0...v3.26.1)
|
6
|
+
|
7
|
+
**Fixed bugs:**
|
8
|
+
|
9
|
+
- Ignore job deserialization errors when mass-retrying through the dashboard [\#1269](https://github.com/bensheldon/good_job/pull/1269) ([bensheldon](https://github.com/bensheldon))
|
10
|
+
|
11
|
+
**Closed issues:**
|
12
|
+
|
13
|
+
- Plain HTTP 500 Error when retrying a job for deleted record [\#1263](https://github.com/bensheldon/good_job/issues/1263)
|
14
|
+
|
3
15
|
## [v3.26.0](https://github.com/bensheldon/good_job/tree/v3.26.0) (2024-03-01)
|
4
16
|
|
5
17
|
[Full Changelog](https://github.com/bensheldon/good_job/compare/v3.25.0...v3.26.0)
|
@@ -44,10 +44,13 @@ module GoodJob
|
|
44
44
|
end
|
45
45
|
|
46
46
|
job
|
47
|
-
rescue GoodJob::Job::
|
47
|
+
rescue GoodJob::Job::ActiveJobDeserializationError,
|
48
|
+
GoodJob::Job::ActionForStateMismatchError,
|
49
|
+
GoodJob::AdvisoryLockable::RecordAlreadyAdvisoryLockedError
|
48
50
|
nil
|
49
51
|
end.compact
|
50
52
|
|
53
|
+
# TODO: Put these messages through I18n
|
51
54
|
notice = if processed_jobs.any?
|
52
55
|
"Successfully #{ACTIONS[mass_action]} #{processed_jobs.count} #{'job'.pluralize(processed_jobs.count)}"
|
53
56
|
else
|
@@ -94,11 +97,14 @@ module GoodJob
|
|
94
97
|
private
|
95
98
|
|
96
99
|
def redirect_on_error(exception)
|
100
|
+
# TODO: Put these messages through I18n
|
97
101
|
alert = case exception
|
98
102
|
when GoodJob::Job::AdapterNotGoodJobError
|
99
103
|
"Active Job Queue Adapter must be GoodJob."
|
100
104
|
when GoodJob::Job::ActionForStateMismatchError
|
101
105
|
"Job is not in an appropriate state for this action."
|
106
|
+
when GoodJob::Job::ActiveJobDeserializationError
|
107
|
+
"Active Job data could not be deserialized."
|
102
108
|
else
|
103
109
|
exception.to_s
|
104
110
|
end
|
@@ -104,8 +104,10 @@ module GoodJob
|
|
104
104
|
def active_job(ignore_deserialization_errors: false)
|
105
105
|
ActiveJob::Base.deserialize(active_job_data).tap do |aj|
|
106
106
|
aj.send(:deserialize_arguments_if_needed)
|
107
|
+
rescue ActiveJob::DeserializationError
|
108
|
+
raise unless ignore_deserialization_errors
|
107
109
|
end
|
108
|
-
rescue
|
110
|
+
rescue NameError
|
109
111
|
raise unless ignore_deserialization_errors
|
110
112
|
end
|
111
113
|
|
data/app/models/good_job/job.rb
CHANGED
@@ -13,6 +13,8 @@ module GoodJob
|
|
13
13
|
AdapterNotGoodJobError = Class.new(StandardError)
|
14
14
|
# Attached to a Job's Execution when the Job is discarded.
|
15
15
|
DiscardJobError = Class.new(StandardError)
|
16
|
+
# Raised when Active Job data cannot be deserialized
|
17
|
+
ActiveJobDeserializationError = Class.new(StandardError)
|
16
18
|
|
17
19
|
class << self
|
18
20
|
delegate :table_name, to: GoodJob::Execution
|
@@ -186,8 +188,9 @@ module GoodJob
|
|
186
188
|
def retry_job
|
187
189
|
with_advisory_lock do
|
188
190
|
execution = head_execution(reload: true)
|
189
|
-
active_job = execution.active_job
|
191
|
+
active_job = execution.active_job(ignore_deserialization_errors: true)
|
190
192
|
|
193
|
+
raise ActiveJobDeserializationError if active_job.nil?
|
191
194
|
raise AdapterNotGoodJobError unless active_job.class.queue_adapter.is_a? GoodJob::Adapter
|
192
195
|
raise ActionForStateMismatchError if execution.finished_at.blank? || execution.error.blank?
|
193
196
|
|
data/lib/good_job/version.rb
CHANGED