good_job 3.15.10 → 3.15.11

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: 000bb49d312d0103d77ce95d27e79316b7ee66b1056e0566cc1029272442c77a
4
- data.tar.gz: f990fccc402be6ac4dca1e2c8c8f3f57c2a73b00d5c1a065afa1d9ca6645f602
3
+ metadata.gz: 983b4d8a2381c6564ab48334b2587ae33dee8cf1385d72456f29caf8dd99e26d
4
+ data.tar.gz: fd4a54679b61b925f3c0fe6eb07d490f6b92014e2b7a12ac869f77c4c32482e2
5
5
  SHA512:
6
- metadata.gz: db26d83de8e6f07447d1ae866ea065a4b8beb37bd9c93d726929b8d0972ba0f862efd641128bffe35e964fcf2589459d60f57751f4b20d7ab16fc1daeb35a82e
7
- data.tar.gz: aae23731a957a0418f13eadc9e2deab3f5378286cb3e40c00f2cf0341dd99d1a0a73f49873835f14c7e2032a4a1738310038752da8e270ac0864591c662811ad
6
+ metadata.gz: 3d2d8be450c7f282e6b59c6a4730ab0eebb77c2f8c45eadf0fe556b6490b6b6e38cb247e205da275930f6bd2c4a5d23e844088004a13454e2286af72a001c095
7
+ data.tar.gz: 61764d8612c50fa00ea2c5aadf2d2d5ea365f771cb43aedc87bc7456d0d2a1381a3985a518ffeecd382bec27b838ce423268175e0b68687a6722ef77d2b38f88
data/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # Changelog
2
2
 
3
+ ## [v3.15.11](https://github.com/bensheldon/good_job/tree/v3.15.11) (2023-06-06)
4
+
5
+ [Full Changelog](https://github.com/bensheldon/good_job/compare/v3.15.10...v3.15.11)
6
+
7
+ **Fixed bugs:**
8
+
9
+ - Fix `discrete_executions` job re-enqueueing when `retry_job` is called directly [\#973](https://github.com/bensheldon/good_job/pull/973) ([bensheldon](https://github.com/bensheldon))
10
+
11
+ **Closed issues:**
12
+
13
+ - Unclear how discrete executions should work with reenqueued jobs \(leads to broken job-iteration\) [\#972](https://github.com/bensheldon/good_job/issues/972)
14
+ - `build_for_enqueue` discards `scheduled_at` values for bulk-enqueued jobs [\#966](https://github.com/bensheldon/good_job/issues/966)
15
+
3
16
  ## [v3.15.10](https://github.com/bensheldon/good_job/tree/v3.15.10) (2023-05-22)
4
17
 
5
18
  [Full Changelog](https://github.com/bensheldon/good_job/compare/v3.15.9...v3.15.10)
@@ -314,6 +314,8 @@ module GoodJob
314
314
  execution = current_execution
315
315
  execution.assign_attributes(enqueue_args(active_job, { scheduled_at: scheduled_at }))
316
316
  execution.scheduled_at ||= Time.current
317
+ # TODO: these values ideally shouldn't be persisted until the current_execution is finished
318
+ # which will require handling `retry_job` being called from outside the execution context.
317
319
  execution.performed_at = nil
318
320
  execution.finished_at = nil
319
321
  else
@@ -335,7 +337,11 @@ module GoodJob
335
337
  instrument_payload[:execution] = execution
336
338
  execution.save!
337
339
 
338
- CurrentThread.execution.retried_good_job_id = execution.id if retried && !CurrentThread.execution.discrete?
340
+ if retried
341
+ CurrentThread.execution_retried = true
342
+ CurrentThread.execution.retried_good_job_id = execution.id unless current_execution.discrete?
343
+ end
344
+
339
345
  active_job.provider_job_id = execution.id
340
346
  execution
341
347
  end
@@ -402,9 +408,9 @@ module GoodJob
402
408
  instrument_payload.merge!(
403
409
  value: value,
404
410
  handled_error: handled_error,
405
- retried: current_thread.error_on_retry.present?
411
+ retried: current_thread.execution_retried
406
412
  )
407
- ExecutionResult.new(value: value, handled_error: handled_error, retried: current_thread.error_on_retry.present?)
413
+ ExecutionResult.new(value: value, handled_error: handled_error, retried: current_thread.execution_retried)
408
414
  rescue StandardError => e
409
415
  instrument_payload[:unhandled_error] = e
410
416
  ExecutionResult.new(value: nil, unhandled_error: e)
@@ -13,6 +13,7 @@ module GoodJob
13
13
  error_on_retry
14
14
  execution
15
15
  execution_interrupted
16
+ execution_retried
16
17
  ].freeze
17
18
 
18
19
  # @!attribute [rw] cron_at
@@ -51,6 +52,12 @@ module GoodJob
51
52
  # @return [Boolean, nil]
52
53
  thread_mattr_accessor :execution_interrupted
53
54
 
55
+ # @!attribute [rw] execution_retried
56
+ # @!scope class
57
+ # Execution Retried
58
+ # @return [Boolean, nil]
59
+ thread_mattr_accessor :execution_retried
60
+
54
61
  # Resets attributes
55
62
  # @param [Hash] values to assign
56
63
  # @return [void]
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
  module GoodJob
3
3
  # GoodJob gem version.
4
- VERSION = '3.15.10'
4
+ VERSION = '3.15.11'
5
5
 
6
6
  # GoodJob version as Gem::Version object
7
7
  GEM_VERSION = Gem::Version.new(VERSION)
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.15.10
4
+ version: 3.15.11
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-05-22 00:00:00.000000000 Z
11
+ date: 2023-06-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activejob