good_job 4.10.2 → 4.11.1

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: e0d6a590e473a36f203da135a4aa2445783fcd5ba370be41db80683f5a6fc1da
4
- data.tar.gz: 28c4ddb21bc9b3039682a046f4c1f06c720fd291049cdb75a56445ad22295c48
3
+ metadata.gz: c69e8c15dd5fb5a07db3dd7bba0c71d9a519dd493c81510cb5ff8ff2cc3aa511
4
+ data.tar.gz: 7d6c2e2b36b732bdef7d1176f9c56c1f2846f9c8eb3f919af80c039cbf5b4fce
5
5
  SHA512:
6
- metadata.gz: 54e8a9fe882b2b78aa1530ce409a19d429a3b46a895fad218412a05e66266680cd294ca1ab64474b8e43f55a0e3e3012e3e5faed9d9655654270b09c760ed10b
7
- data.tar.gz: 4b504486b0e28279ec048188d3d956543327eac00d03f59a5d585a2960185d232da1d2d435c7d749a2eadf7feb365a1d1175528222de9962e1c01dc33f8c22c5
6
+ metadata.gz: 1a02075581a2d702880e99804db959c67d40d06d946a4392961d635c3b57c484c54755c2fe2cc024e9ca0eac5c9d40a164181dc515e07d6b48672553f907cf75
7
+ data.tar.gz: 19db6c5195211f4fd0c1eda703d4cf6444ae4afcb4cb8b5388e44d9c0fa21ca5007c97c438b8821b8871a304842c4ad536ae8878eb4b29fdf585b08c78a983da
data/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # Changelog
2
2
 
3
+ ## [v4.11.1](https://github.com/bensheldon/good_job/tree/v4.11.1) (2025-06-30)
4
+
5
+ [Full Changelog](https://github.com/bensheldon/good_job/compare/v4.11.0...v4.11.1)
6
+
7
+ **Merged pull requests:**
8
+
9
+ - Add `require rails` to good\_job/engine.rb to allow `bundle console` usage [\#1653](https://github.com/bensheldon/good_job/pull/1653) ([bensheldon](https://github.com/bensheldon))
10
+
11
+ ## [v4.11.0](https://github.com/bensheldon/good_job/tree/v4.11.0) (2025-06-30)
12
+
13
+ [Full Changelog](https://github.com/bensheldon/good_job/compare/v4.10.2...v4.11.0)
14
+
15
+ **Implemented enhancements:**
16
+
17
+ - Add GoodJob::Adapter\#stopping to support Active Job continuations feature [\#1646](https://github.com/bensheldon/good_job/pull/1646) ([bensheldon](https://github.com/bensheldon))
18
+
19
+ **Merged pull requests:**
20
+
21
+ - Fix Probe Server handling server shutdown on SIGINT when daemonized [\#1644](https://github.com/bensheldon/good_job/pull/1644) ([bensheldon](https://github.com/bensheldon))
22
+
3
23
  ## [v4.10.2](https://github.com/bensheldon/good_job/tree/v4.10.2) (2025-05-29)
4
24
 
5
25
  [Full Changelog](https://github.com/bensheldon/good_job/compare/v4.10.1...v4.10.2)
@@ -173,6 +173,15 @@ module GoodJob
173
173
  end
174
174
  end
175
175
 
176
+ # Whether the current job execution thread is shutting down.
177
+ # This is intended to be called from within the context of a performing job.
178
+ # Jobs can call this while performing via `queue_adapter.stopping?` to support
179
+ # job continuations/iterations.
180
+ # @return [Boolean]
181
+ def stopping?
182
+ GoodJob.current_thread_shutting_down?
183
+ end
184
+
176
185
  # Shut down the thread pool executors.
177
186
  # @param timeout [nil, Numeric, NONE] Seconds to wait for active threads.
178
187
  # * +nil+ trigger a shutdown but not wait for it to complete.
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "active_support/core_ext/numeric/time"
4
+
3
5
  module GoodJob
4
6
  #
5
7
  # +GoodJob::Configuration+ provides normalized configuration information to
@@ -1,5 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "rails"
4
+ require "good_job"
5
+
3
6
  module GoodJob
4
7
  # Ruby on Rails integration.
5
8
  class Engine < ::Rails::Engine
@@ -33,7 +33,7 @@ module GoodJob
33
33
  start_server
34
34
  handle_connections if @running.true?
35
35
  rescue StandardError => e
36
- @logger.error "Server encountered an error: #{e}"
36
+ @logger.error "Server encountered an error: #{e.class} - #{e}"
37
37
  ensure
38
38
  stop
39
39
  end
@@ -60,8 +60,14 @@ module GoodJob
60
60
  end
61
61
 
62
62
  client.close
63
- rescue IO::WaitReadable, Errno::EINTR, Errno::EPIPE
64
- retry
63
+ rescue IO::WaitReadable, Errno::EINTR
64
+ retry # on transient errors
65
+ rescue Errno::EPIPE
66
+ next # Client disconnected - continue
67
+ rescue Errno::EBADF
68
+ break if @server&.closed? # Server shut down - stop
69
+
70
+ raise
65
71
  end
66
72
  end
67
73
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  module GoodJob
4
4
  # GoodJob gem version.
5
- VERSION = '4.10.2'
5
+ VERSION = '4.11.1'
6
6
 
7
7
  # GoodJob version as Gem::Version object
8
8
  GEM_VERSION = Gem::Version.new(VERSION)
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: good_job
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.10.2
4
+ version: 4.11.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Sheldon
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 1980-01-02 00:00:00.000000000 Z
10
+ date: 2025-06-30 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: activejob
@@ -240,9 +240,9 @@ executables:
240
240
  - good_job
241
241
  extensions: []
242
242
  extra_rdoc_files:
243
+ - README.md
243
244
  - CHANGELOG.md
244
245
  - LICENSE.txt
245
- - README.md
246
246
  files:
247
247
  - CHANGELOG.md
248
248
  - LICENSE.txt
@@ -421,7 +421,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
421
421
  - !ruby/object:Gem::Version
422
422
  version: '0'
423
423
  requirements: []
424
- rubygems_version: 3.6.8
424
+ rubygems_version: 3.6.2
425
425
  specification_version: 4
426
426
  summary: A multithreaded, Postgres-based ActiveJob backend for Ruby on Rails
427
427
  test_files: []