good_job 4.9.1 → 4.9.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: 257efee85262d3d49be021082bc73cce8dfcf2bea117841a31862bb592158593
4
- data.tar.gz: d5adc70dcd2894ce5190e07eab45e322c7724f74d96f5a4ccf96bee3c1b35798
3
+ metadata.gz: eebb74f90c823f1b2dd3dbeeecffc6279b072d5929182c7734357ce98ebd3a1a
4
+ data.tar.gz: f0df3c322938cb34d9a5686a344db8e412a2878473ff778928006855ab8339a1
5
5
  SHA512:
6
- metadata.gz: 003cb3656a88bcd02e8354e315dff667a284d3cae0674ff8b5f73a7cbcfd0ed1b60faf27ff23b14a1d83e395209d4292cfb8e6d771835c4a9418c8ff1977b327
7
- data.tar.gz: c13483d1ac9f15a720b161905cab041f2c52f7305568b885bfeb0c7fbc514662023cde9ff87fe09f99811536285265aa3d3a4aa31113f73c026f1d39a5521b88
6
+ metadata.gz: a91aae2a4768af8c89c8b0e2b04898d70dbe145b8808f2e1cc60fd18dd63faafd3679ca7444abd9e6863b7991b778ee709ba8949ac791362ff850c7aca3dcb5c
7
+ data.tar.gz: e3df10dbd134f6e335938578c0050e838d2b0073a6a3d7f64a90313e70afd214e76307df146be840dc8fecfcfca32bcb4ea9671f7549573c2e0e32adb8006a7a
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## [v4.9.2](https://github.com/bensheldon/good_job/tree/v4.9.2) (2025-03-09)
4
+
5
+ [Full Changelog](https://github.com/bensheldon/good_job/compare/v4.9.1...v4.9.2)
6
+
7
+ **Fixed bugs:**
8
+
9
+ - Quiet duplicate cron enqueue logging by pretending it was halted at before\_enqueue [\#1615](https://github.com/bensheldon/good_job/pull/1615) ([bensheldon](https://github.com/bensheldon))
10
+
3
11
  ## [v4.9.1](https://github.com/bensheldon/good_job/tree/v4.9.1) (2025-03-09)
4
12
 
5
13
  [Full Changelog](https://github.com/bensheldon/good_job/compare/v4.9.0...v4.9.1)
@@ -110,8 +110,6 @@ module GoodJob # :nodoc:
110
110
  kwargs_value.present? ? configured_job.perform_later(*args_value, **kwargs_value) : configured_job.perform_later(*args_value)
111
111
  end
112
112
  end
113
- rescue ActiveRecord::RecordNotUnique
114
- false
115
113
  end
116
114
 
117
115
  def display_properties
@@ -387,7 +387,16 @@ module GoodJob
387
387
  end
388
388
 
389
389
  instrument_payload[:job] = job
390
- job.save!
390
+ begin
391
+ job.save!
392
+ rescue ActiveRecord::RecordNotUnique
393
+ raise unless job.cron_key
394
+
395
+ # Active Job doesn't have a clean way to cancel an enqueue for unexceptional reasons
396
+ # This is a workaround to mark it as having been halted in before_enqueue
397
+ active_job.send(:halted_callback_hook, "duplicate_cron_key", "good_job")
398
+ return false
399
+ end
391
400
 
392
401
  CurrentThread.retried_job = job if retried
393
402
 
@@ -163,8 +163,10 @@ module GoodJob
163
163
  scheduled_at: scheduled_at
164
164
  )
165
165
 
166
- executed_locally = execute_async? && @capsule&.create_thread(job.job_state)
167
- Notifier.notify(job.job_state) if !executed_locally && send_notify?(active_job)
166
+ if job
167
+ executed_locally = execute_async? && @capsule&.create_thread(job.job_state)
168
+ Notifier.notify(job.job_state) if !executed_locally && send_notify?(active_job)
169
+ end
168
170
  end
169
171
 
170
172
  job
@@ -2,7 +2,7 @@
2
2
 
3
3
  module GoodJob
4
4
  # GoodJob gem version.
5
- VERSION = '4.9.1'
5
+ VERSION = '4.9.2'
6
6
 
7
7
  # GoodJob version as Gem::Version object
8
8
  GEM_VERSION = Gem::Version.new(VERSION)
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: 4.9.1
4
+ version: 4.9.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Sheldon