good_job 3.17.0 → 3.17.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: 946d6d7912809cf31d3f79c0dc7e2c074b20c7bcd853d6c3a9ab35faa5f4f6aa
4
- data.tar.gz: d33a7a41a7c8c259d71c5e8caa7fb268ec0db2c7516a4fb45d937c4e05d5fb64
3
+ metadata.gz: 8c92206b4099b3be756adba01af60f4ef531eaf8cf02a9c9cdd17129214f929c
4
+ data.tar.gz: 29f1e72a6b21d2f1e3d073d8b1bd9f4f2a78e417f69c21c195fc795f62ac4e5c
5
5
  SHA512:
6
- metadata.gz: e849433834f758352c918379f1c727d3b992cd6843f9f27de4768d2f7845402f5c9b418cb93da285811df55882d0a0a6acac90bcedf1bdeac9dbafca66e7af54
7
- data.tar.gz: fe3ae7523b7d9307a085a298a771301b3d9707495a24866eec113bbc172a83ffedfe68e452c1b925e0e04f2a5a54175a995c2c312f1f3033e860615182015c2a
6
+ metadata.gz: 2906c0b22dc6f6b0f0e78c607467533598e84dce2a29e654321293da877f1afd09ee59afd534d7a7b7f1481ae796d111b2492f62ec2cddcde843442e4262adbe
7
+ data.tar.gz: 0e8107f018f836e0d15f5836d93ebb8bdbe6e36381cba63680113302e3125f1a49d9aba5e05a2124ce50ec51cbfde7059ebed30b3cc5b64d859ce16867ae2c5e
data/CHANGELOG.md CHANGED
@@ -1,5 +1,39 @@
1
1
  # Changelog
2
2
 
3
+ ## [v3.17.2](https://github.com/bensheldon/good_job/tree/v3.17.2) (2023-08-10)
4
+
5
+ [Full Changelog](https://github.com/bensheldon/good_job/compare/v3.17.1...v3.17.2)
6
+
7
+ **Fixed bugs:**
8
+
9
+ - 3.17.0 breaks health check endpoints [\#1033](https://github.com/bensheldon/good_job/issues/1033)
10
+ - Fix NoMethodError: undefined method `silence' for nil:NilClass [\#1037](https://github.com/bensheldon/good_job/pull/1037) ([afn](https://github.com/afn))
11
+
12
+ **Closed issues:**
13
+
14
+ - NoMethodError in ProcessHeartbeat if ActiveRecord logger is nil [\#1036](https://github.com/bensheldon/good_job/issues/1036)
15
+ - JRuby deprecation policy [\#1035](https://github.com/bensheldon/good_job/issues/1035)
16
+
17
+ **Merged pull requests:**
18
+
19
+ - Add helpful failure output for Sorbet linter [\#1038](https://github.com/bensheldon/good_job/pull/1038) ([bensheldon](https://github.com/bensheldon))
20
+
21
+ ## [v3.17.1](https://github.com/bensheldon/good_job/tree/v3.17.1) (2023-08-08)
22
+
23
+ [Full Changelog](https://github.com/bensheldon/good_job/compare/v3.17.0...v3.17.1)
24
+
25
+ **Fixed bugs:**
26
+
27
+ - Fix Probe Server by retrying IO.select instead of returning early [\#1034](https://github.com/bensheldon/good_job/pull/1034) ([bensheldon](https://github.com/bensheldon))
28
+
29
+ **Closed issues:**
30
+
31
+ - Add database connection pool details to Process state [\#1014](https://github.com/bensheldon/good_job/issues/1014)
32
+
33
+ **Merged pull requests:**
34
+
35
+ - Add YARD warnings to lint script; fix YARD warnings [\#1032](https://github.com/bensheldon/good_job/pull/1032) ([bensheldon](https://github.com/bensheldon))
36
+
3
37
  ## [v3.17.0](https://github.com/bensheldon/good_job/tree/v3.17.0) (2023-08-06)
4
38
 
5
39
  [Full Changelog](https://github.com/bensheldon/good_job/compare/v3.16.4...v3.17.0)
@@ -12,9 +12,9 @@ module GoodJob
12
12
  self.table_name = 'good_jobs'
13
13
 
14
14
  # With a given class name
15
- # @!method job_class
15
+ # @!method job_class(name)
16
16
  # @!scope class
17
- # @param string [String] Execution class name
17
+ # @param name [String] Execution class name
18
18
  # @return [ActiveRecord::Relation]
19
19
  scope :job_class, ->(name) { where(params_job_class.eq(name)) }
20
20
 
@@ -28,6 +28,18 @@ module GoodJob
28
28
  false
29
29
  end
30
30
 
31
+ # Runs the block with self.logger silenced.
32
+ # If self.logger is nil, simply runs the block.
33
+ def self.with_logger_silenced(&block)
34
+ # Assign to a local variable, just in case it's modified in another thread concurrently
35
+ logger = self.logger
36
+ if logger
37
+ logger.silence(&block)
38
+ else
39
+ yield
40
+ end
41
+ end
42
+
31
43
  ActiveSupport.run_load_hooks(:good_job_base_record, self)
32
44
  end
33
45
  end
@@ -50,7 +50,6 @@ module GoodJob
50
50
  )
51
51
 
52
52
  # Create a new batch and enqueue it
53
- # @param on_finish [String, Object] The class name of the callback job to be enqueued after the batch is finished
54
53
  # @param properties [Hash] Additional properties to be stored on the batch
55
54
  # @param block [Proc] Enqueue jobs within the block to add them to the batch
56
55
  # @return [GoodJob::BatchRecord]
@@ -76,7 +76,7 @@ module GoodJob
76
76
  }, if: -> { @_destroy_job }
77
77
 
78
78
  # Get executions with given ActiveJob ID
79
- # @!method active_job_id
79
+ # @!method active_job_id(active_job_id)
80
80
  # @!scope class
81
81
  # @param active_job_id [String]
82
82
  # ActiveJob ID
@@ -115,7 +115,7 @@ module GoodJob
115
115
  scope :creation_ordered, -> { order(created_at: :asc) }
116
116
 
117
117
  # Order executions for de-queueing
118
- # @!method dequeueing_ordered
118
+ # @!method dequeueing_ordered(parsed_queues)
119
119
  # @!scope class
120
120
  # @param parsed_queues [Hash]
121
121
  # optional output of .queue_parser, parsed queues, will be used for
@@ -130,7 +130,7 @@ module GoodJob
130
130
  end)
131
131
 
132
132
  # Order executions in order of queues in array param
133
- # @!method queue_ordered
133
+ # @!method queue_ordered(queues)
134
134
  # @!scope class
135
135
  # @param queues [Array<string] ordered names of queues
136
136
  # @return [ActiveRecord::Relation]
@@ -300,9 +300,6 @@ module GoodJob
300
300
  # Epoch timestamp when the job should be executed, if blank will delegate to the ActiveJob instance
301
301
  # @param create_with_advisory_lock [Boolean]
302
302
  # Whether to establish a lock on the {Execution} record after it is created.
303
- # @param persist_immediately [Boolean]
304
- # Whether to save the record immediately or just initialize it with values. When bulk-inserting
305
- # jobs the caller takes care of the persistence and sets this parameter to `false`
306
303
  # @return [Execution]
307
304
  # The new {Execution} instance representing the queued ActiveJob job.
308
305
  def self.enqueue(active_job, scheduled_at: nil, create_with_advisory_lock: false)
@@ -44,7 +44,7 @@ module GoodJob
44
44
  while @running.true?
45
45
  begin
46
46
  ready_sockets, = IO.select([@server], nil, nil, SOCKET_READ_TIMEOUT)
47
- return unless ready_sockets
47
+ next unless ready_sockets
48
48
 
49
49
  client = @server.accept_nonblock(exception: false)
50
50
  request = client.gets
@@ -23,7 +23,7 @@ module GoodJob # :nodoc:
23
23
  def refresh_process
24
24
  Rails.application.executor.wrap do
25
25
  GoodJob::Process.with_connection(connection) do
26
- GoodJob::Process.logger.silence do
26
+ GoodJob::Process.with_logger_silenced do
27
27
  @process&.refresh_if_stale(cleanup: true)
28
28
  end
29
29
  end
@@ -91,7 +91,7 @@ module SdNotify
91
91
  notify(FDSTORE, unset_env)
92
92
  end
93
93
 
94
- # @param [Boolean] true if the service manager expects watchdog keep-alive
94
+ # @return [Boolean] true if the service manager expects watchdog keep-alive
95
95
  # notification messages to be sent from this process.
96
96
  #
97
97
  # If the $WATCHDOG_USEC environment variable is set,
@@ -2,7 +2,7 @@
2
2
 
3
3
  module GoodJob
4
4
  # GoodJob gem version.
5
- VERSION = '3.17.0'
5
+ VERSION = '3.17.2'
6
6
 
7
7
  # GoodJob version as Gem::Version object
8
8
  GEM_VERSION = Gem::Version.new(VERSION)
data/lib/good_job.rb CHANGED
@@ -111,7 +111,7 @@ module GoodJob
111
111
 
112
112
  # Custom Active Record configuration that is class_eval'ed into +GoodJob::BaseRecord+
113
113
  # @param block Custom Active Record configuration
114
- # @retyrn [void]
114
+ # @return [void]
115
115
  #
116
116
  # @example
117
117
  # GoodJob.configure_active_record do
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.17.0
4
+ version: 3.17.2
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-08-06 00:00:00.000000000 Z
11
+ date: 2023-08-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activejob