good_job 3.28.1 → 3.28.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3bbf6aa5c2cdbc7b2ff5b5f7dd31a219140934b799737c192aa8de55e5030bca
4
- data.tar.gz: 1f7c614722781287cf6482af08fe97d4af5305fdfbd7583ce343277b7b8fe5a1
3
+ metadata.gz: 38648843be987ab00d188e3564768440abc82e43ffe96b628431e34041152e8f
4
+ data.tar.gz: 6d3a99426cc7fab00b03ef81116b84315a1bf634cb6b619f2263a4e367545271
5
5
  SHA512:
6
- metadata.gz: 3f97f043eed52700808203c42ab9a714a7fdefdd33f3a201045a9a1649e675de6305386439f4707788a89842993902187c21b89939e4458e6a1750d25d6972d1
7
- data.tar.gz: a3591c147f153964a0d929d8b49c43386b9f03bf53414471eed55d5312d9bb72e0fbd0ee49b966519570b4a13f33d4fa5ddda91c47d6fa31342af928cfa8185a
6
+ metadata.gz: b3931885de25ffa50f38fa39045238f5a38e4c57f695b8f3e94a1042db09eaf8a87cf3f46b7e01cf498cad60667c63ab1f9bc3c95d8ccc8fb5857cec16e66032
7
+ data.tar.gz: de8333dad6dd69694212e753642667c0be22dd72c39db530369ce4932d438d090e92139a0eb03163e3cd563bf91c21506725a068279e068a14f5ba31c8720e16
data/CHANGELOG.md CHANGED
@@ -1,5 +1,38 @@
1
1
  # Changelog
2
2
 
3
+ ## [v3.28.3](https://github.com/bensheldon/good_job/tree/v3.28.3) (2024-05-18)
4
+
5
+ [Full Changelog](https://github.com/bensheldon/good_job/compare/v3.28.2...v3.28.3)
6
+
7
+ **Fixed bugs:**
8
+
9
+ - Strip more whitespace when parsing queues string [\#1352](https://github.com/bensheldon/good_job/pull/1352) ([bensheldon](https://github.com/bensheldon))
10
+ - Fix latest migration not affecting `GoodJob.migrated?` [\#1345](https://github.com/bensheldon/good_job/pull/1345) ([Earlopain](https://github.com/Earlopain))
11
+
12
+ **Closed issues:**
13
+
14
+ - Whitespace in `queues` configuration can cause issues. [\#1351](https://github.com/bensheldon/good_job/issues/1351)
15
+ - How to properly handle interrupts [\#1343](https://github.com/bensheldon/good_job/issues/1343)
16
+ - ActiveSupport::CurrentAttributes Compatibility [\#1341](https://github.com/bensheldon/good_job/issues/1341)
17
+
18
+ **Merged pull requests:**
19
+
20
+ - Don't abort CI jobs when a single one fails [\#1346](https://github.com/bensheldon/good_job/pull/1346) ([Earlopain](https://github.com/Earlopain))
21
+ - Clarify PgBouncer Compatibility [\#1338](https://github.com/bensheldon/good_job/pull/1338) ([isaac](https://github.com/isaac))
22
+
23
+ ## [v3.28.2](https://github.com/bensheldon/good_job/tree/v3.28.2) (2024-04-26)
24
+
25
+ [Full Changelog](https://github.com/bensheldon/good_job/compare/v3.28.1...v3.28.2)
26
+
27
+ **Fixed bugs:**
28
+
29
+ - Add debug warning message when a job is enqueued within a batch/bulk capture but not to the GoodJob Adapter [\#1339](https://github.com/bensheldon/good_job/pull/1339) ([bensheldon](https://github.com/bensheldon))
30
+
31
+ **Closed issues:**
32
+
33
+ - How do I add jobs to an existing batch? [\#1337](https://github.com/bensheldon/good_job/issues/1337)
34
+ - Executing perform\_now on a good\_job with GoodJobs::ActiveJobExtensions::Concurrency can run twice [\#1335](https://github.com/bensheldon/good_job/issues/1335)
35
+
3
36
  ## [v3.28.1](https://github.com/bensheldon/good_job/tree/v3.28.1) (2024-04-24)
4
37
 
5
38
  [Full Changelog](https://github.com/bensheldon/good_job/compare/v3.28.0...v3.28.1)
@@ -10,7 +43,6 @@
10
43
 
11
44
  **Closed issues:**
12
45
 
13
- - Executing perform\_now on a good\_job with GoodJobs::ActiveJobExtensions::Concurrency can run twice [\#1335](https://github.com/bensheldon/good_job/issues/1335)
14
46
  - `erb_lint` doesn't lint all files [\#1329](https://github.com/bensheldon/good_job/issues/1329)
15
47
  - Server hangs after \#1297 [\#1301](https://github.com/bensheldon/good_job/issues/1301)
16
48
  - Figure out how to use bind parameters for time queries [\#1285](https://github.com/bensheldon/good_job/issues/1285)
data/README.md CHANGED
@@ -1383,7 +1383,7 @@ _Note: Rails `travel`/`travel_to` time helpers do not have millisecond precision
1383
1383
 
1384
1384
  GoodJob is not compatible with PgBouncer in _transaction_ mode, but is compatible with PgBouncer's _connection_ mode. GoodJob uses connection-based advisory locks and LISTEN/NOTIFY, both of which require full database connections.
1385
1385
 
1386
- A workaround to this limitation is to make a direct database connection available to GoodJob. With Rails 6.0's support for [multiple databases](https://guides.rubyonrails.org/active_record_multiple_databases.html), a direct connection to the database can be configured:
1386
+ If you want to use PgBouncer with the rest of your Rails app you can workaround this limitation by making a direct database connection available to GoodJob. With Rails 6.0's support for [multiple databases](https://guides.rubyonrails.org/active_record_multiple_databases.html), a direct connection to the database can be configured by following the three steps below.
1387
1387
 
1388
1388
  1. Define a direct connection to your database that is not proxied through PgBouncer, for example:
1389
1389
 
@@ -40,7 +40,7 @@ module GoodJob
40
40
  # GoodJob::Execution.queue_parser('-queue1,queue2')
41
41
  # => { exclude: [ 'queue1', 'queue2' ] }
42
42
  def self.queue_parser(string)
43
- string = string.presence || '*'
43
+ string = string.strip.presence || '*'
44
44
 
45
45
  case string.first
46
46
  when '-'
@@ -5,6 +5,12 @@ module GoodJob
5
5
  module Batches
6
6
  extend ActiveSupport::Concern
7
7
 
8
+ included do
9
+ before_enqueue do |job|
10
+ GoodJob.logger.debug("#{job.class} was enqueued within a batch or bulk capture block but is not using the GoodJob Adapter; the job will not appear in GoodJob.") if (GoodJob::Bulk.current_buffer || GoodJob::Batch.current_batch_id) && !job.class.queue_adapter.is_a?(GoodJob::Adapter)
11
+ end
12
+ end
13
+
8
14
  def batch
9
15
  @_batch ||= CurrentThread.execution&.batch&.to_batch if CurrentThread.execution.present? && CurrentThread.execution.active_job_id == job_id
10
16
  end
@@ -8,8 +8,8 @@ module GoodJob
8
8
  # @param warm_cache_on_initialize [Boolean]
9
9
  # @return [GoodJob::MultiScheduler]
10
10
  def self.from_configuration(configuration, warm_cache_on_initialize: false)
11
- schedulers = configuration.queue_string.split(';').map do |queue_string_and_max_threads|
12
- queue_string, max_threads = queue_string_and_max_threads.split(':')
11
+ schedulers = configuration.queue_string.split(';').map(&:strip).map do |queue_string_and_max_threads|
12
+ queue_string, max_threads = queue_string_and_max_threads.split(':').map { |str| str.strip.presence }
13
13
  max_threads = (max_threads || configuration.max_threads).to_i
14
14
 
15
15
  job_performer = GoodJob::JobPerformer.new(queue_string)
@@ -2,7 +2,7 @@
2
2
 
3
3
  module GoodJob
4
4
  # GoodJob gem version.
5
- VERSION = '3.28.1'
5
+ VERSION = '3.28.3'
6
6
 
7
7
  # GoodJob version as Gem::Version object
8
8
  GEM_VERSION = Gem::Version.new(VERSION)
data/lib/good_job.rb CHANGED
@@ -277,8 +277,8 @@ module GoodJob
277
277
  # @return [Boolean]
278
278
  def self.migrated?
279
279
  # Always update with the most recent migration check
280
- GoodJob::Execution.reset_column_information
281
- GoodJob::Execution.candidate_lookup_index_migrated?
280
+ GoodJob::DiscreteExecution.reset_column_information
281
+ GoodJob::DiscreteExecution.backtrace_migrated?
282
282
  end
283
283
 
284
284
  ActiveSupport.run_load_hooks(:good_job, self)
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.28.1
4
+ version: 3.28.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Sheldon
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-04-24 00:00:00.000000000 Z
11
+ date: 2024-05-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activejob
@@ -357,9 +357,9 @@ files:
357
357
  - lib/generators/good_job/templates/update/migrations/07_recreate_good_job_cron_indexes_with_conditional.rb.erb
358
358
  - lib/generators/good_job/templates/update/migrations/08_create_good_job_labels.rb.erb
359
359
  - lib/generators/good_job/templates/update/migrations/09_create_good_job_labels_index.rb.erb
360
- - lib/generators/good_job/templates/update/migrations/10_create_good_job_execution_error_backtrace.rb.erb
361
360
  - lib/generators/good_job/templates/update/migrations/10_remove_good_job_active_id_index.rb.erb
362
361
  - lib/generators/good_job/templates/update/migrations/11_create_index_good_job_jobs_for_candidate_lookup.rb.erb
362
+ - lib/generators/good_job/templates/update/migrations/12_create_good_job_execution_error_backtrace.rb.erb
363
363
  - lib/generators/good_job/update_generator.rb
364
364
  - lib/good_job.rb
365
365
  - lib/good_job/active_job_extensions/batches.rb