good_job 3.7.1 → 3.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 79ee8980f9408a7e530f6dbc4037f742033e3dbe9919442f08e854314730ef31
4
- data.tar.gz: bf17a0b7e1fe8cb4d4f7bdfd20b333e2f9e1ce67504e34a9195e1e0921827284
3
+ metadata.gz: 820584e338535d72bf53a7e41718998ee39f718a9b77bc20a5a382b4deb7a8d0
4
+ data.tar.gz: a9a8285fce5d8a7345ce22903f24dafc9217dc853a93161fad6e7df1efede5b4
5
5
  SHA512:
6
- metadata.gz: 955afa8f3f3a224afb58824525a1b230abecbdbfd395e4e31a8dad5498fb32618c77d1e3c70a1503a3228c8e8ea3bdfdb4dccb9238ff0554ad43005e325a64c5
7
- data.tar.gz: '029ba620af1d42c78b5b0d61524ac5338f501383b7ed166ff559cff4f0505a81485bef07b8aa04179ab17ab9fa6fca96a84b2a61694e7da18832b365fde8e1a1'
6
+ metadata.gz: 4a52184bd60ba084f42949096149c5b85defa7db032b61aedb3204d125cbc0a84d8d39dcba6316c49ad7f0a6e23c41109b12fd9f3dc9d1df2eeb86b7c12c3268
7
+ data.tar.gz: 54868876aefebb9668ee83b900b123c5ce512bd6b805cd6f005dbb9a60573b947b42d559ae1608b624dd21a4f70a8379ba3ad1eacc1f2f293ec3925c77fed913
data/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # Changelog
2
2
 
3
+ ## [v3.7.2](https://github.com/bensheldon/good_job/tree/v3.7.2) (2022-12-12)
4
+
5
+ [Full Changelog](https://github.com/bensheldon/good_job/compare/v3.7.1...v3.7.2)
6
+
7
+ **Closed issues:**
8
+
9
+ - Unable to discard failed jobs which crashed with `ActiveJob::DeserializationError` [\#770](https://github.com/bensheldon/good_job/issues/770)
10
+
11
+ **Merged pull requests:**
12
+
13
+ - Ignore ActiveJob::DeserializationError when discarding jobs [\#771](https://github.com/bensheldon/good_job/pull/771) ([nickcampbell18](https://github.com/nickcampbell18))
14
+ - Bump rubocop from 1.39.0 to 1.40.0 [\#769](https://github.com/bensheldon/good_job/pull/769) ([dependabot[bot]](https://github.com/apps/dependabot))
15
+
3
16
  ## [v3.7.1](https://github.com/bensheldon/good_job/tree/v3.7.1) (2022-12-12)
4
17
 
5
18
  [Full Changelog](https://github.com/bensheldon/good_job/compare/v3.7.0...v3.7.1)
@@ -316,9 +316,16 @@ module GoodJob
316
316
  self.class.unscoped.unfinished.owns_advisory_locked.exists?(id: id)
317
317
  end
318
318
 
319
- def active_job
319
+ # Build an ActiveJob instance and deserialize the arguments, using `#active_job_data`.
320
+ #
321
+ # @param ignore_deserialization_errors [Boolean]
322
+ # Whether to ignore ActiveJob::DeserializationError when deserializing the arguments.
323
+ # This is most useful if you aren't planning to use the arguments directly.
324
+ def active_job(ignore_deserialization_errors: false)
320
325
  ActiveJob::Base.deserialize(active_job_data).tap do |aj|
321
326
  aj.send(:deserialize_arguments_if_needed)
327
+ rescue ActiveJob::DeserializationError
328
+ raise unless ignore_deserialization_errors
322
329
  end
323
330
  end
324
331
 
@@ -206,7 +206,7 @@ module GoodJob
206
206
  def discard_job(message)
207
207
  with_advisory_lock do
208
208
  execution = head_execution(reload: true)
209
- active_job = execution.active_job
209
+ active_job = execution.active_job(ignore_deserialization_errors: true)
210
210
 
211
211
  raise ActionForStateMismatchError if execution.finished_at.present?
212
212
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
  module GoodJob
3
3
  # GoodJob gem version.
4
- VERSION = '3.7.1'
4
+ VERSION = '3.7.2'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: good_job
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.7.1
4
+ version: 3.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Sheldon