good_job 2.17.1 → 3.0.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.
Files changed (28) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +44 -1
  3. data/README.md +45 -26
  4. data/app/charts/good_job/scheduled_by_queue_chart.rb +1 -1
  5. data/app/controllers/good_job/jobs_controller.rb +11 -11
  6. data/app/controllers/good_job/processes_controller.rb +1 -1
  7. data/app/filters/good_job/jobs_filter.rb +2 -2
  8. data/app/views/good_job/processes/index.html.erb +1 -9
  9. data/app/views/layouts/good_job/application.html.erb +1 -1
  10. data/lib/generators/good_job/templates/update/migrations/01_create_good_jobs.rb.erb +9 -0
  11. data/lib/good_job/adapter.rb +6 -49
  12. data/lib/good_job/configuration.rb +4 -4
  13. data/lib/good_job/current_thread.rb +2 -2
  14. data/lib/good_job/notifier/process_registration.rb +0 -4
  15. data/lib/good_job/version.rb +1 -1
  16. data/lib/good_job.rb +7 -9
  17. data/lib/models/good_job/active_job_job.rb +6 -219
  18. data/lib/{good_job → models/good_job}/cron_entry.rb +3 -3
  19. data/lib/models/good_job/execution.rb +3 -11
  20. data/lib/models/good_job/job.rb +224 -0
  21. data/lib/{good_job → models/good_job}/lockable.rb +0 -0
  22. data/lib/models/good_job/process.rb +0 -9
  23. metadata +23 -27
  24. data/lib/generators/good_job/templates/update/migrations/02_add_cron_at_to_good_jobs.rb.erb +0 -14
  25. data/lib/generators/good_job/templates/update/migrations/03_add_cron_key_cron_at_index_to_good_jobs.rb.erb +0 -20
  26. data/lib/generators/good_job/templates/update/migrations/04_create_good_job_processes.rb.erb +0 -17
  27. data/lib/generators/good_job/templates/update/migrations/04_index_good_job_jobs_on_finished_at.rb.erb +0 -25
  28. data/lib/good_job/job.rb +0 -11
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: 2.17.1
4
+ version: 3.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Sheldon
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-06-24 00:00:00.000000000 Z
11
+ date: 2022-07-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activejob
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 5.2.0
19
+ version: 6.0.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 5.2.0
26
+ version: 6.0.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: activerecord
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 5.2.0
33
+ version: 6.0.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: 5.2.0
40
+ version: 6.0.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: concurrent-ruby
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -72,14 +72,14 @@ dependencies:
72
72
  requirements:
73
73
  - - ">="
74
74
  - !ruby/object:Gem::Version
75
- version: 5.2.0
75
+ version: 6.0.0
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
- version: 5.2.0
82
+ version: 6.0.0
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: thor
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -140,16 +140,16 @@ dependencies:
140
140
  name: capybara
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
- - - "~>"
143
+ - - ">="
144
144
  - !ruby/object:Gem::Version
145
- version: 3.35.0
145
+ version: '0'
146
146
  type: :development
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
- - - "~>"
150
+ - - ">="
151
151
  - !ruby/object:Gem::Version
152
- version: 3.35.0
152
+ version: '0'
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: database_cleaner
155
155
  requirement: !ruby/object:Gem::Requirement
@@ -294,16 +294,16 @@ dependencies:
294
294
  name: selenium-webdriver
295
295
  requirement: !ruby/object:Gem::Requirement
296
296
  requirements:
297
- - - "~>"
297
+ - - ">="
298
298
  - !ruby/object:Gem::Version
299
- version: '3.142'
299
+ version: '0'
300
300
  type: :development
301
301
  prerelease: false
302
302
  version_requirements: !ruby/object:Gem::Requirement
303
303
  requirements:
304
- - - "~>"
304
+ - - ">="
305
305
  - !ruby/object:Gem::Version
306
- version: '3.142'
306
+ version: '0'
307
307
  - !ruby/object:Gem::Dependency
308
308
  name: sigdump
309
309
  requirement: !ruby/object:Gem::Requirement
@@ -414,10 +414,6 @@ files:
414
414
  - lib/generators/good_job/install_generator.rb
415
415
  - lib/generators/good_job/templates/install/migrations/create_good_jobs.rb.erb
416
416
  - lib/generators/good_job/templates/update/migrations/01_create_good_jobs.rb.erb
417
- - lib/generators/good_job/templates/update/migrations/02_add_cron_at_to_good_jobs.rb.erb
418
- - lib/generators/good_job/templates/update/migrations/03_add_cron_key_cron_at_index_to_good_jobs.rb.erb
419
- - lib/generators/good_job/templates/update/migrations/04_create_good_job_processes.rb.erb
420
- - lib/generators/good_job/templates/update/migrations/04_index_good_job_jobs_on_finished_at.rb.erb
421
417
  - lib/generators/good_job/update_generator.rb
422
418
  - lib/good_job.rb
423
419
  - lib/good_job/active_job_extensions.rb
@@ -427,7 +423,6 @@ files:
427
423
  - lib/good_job/cleanup_tracker.rb
428
424
  - lib/good_job/cli.rb
429
425
  - lib/good_job/configuration.rb
430
- - lib/good_job/cron_entry.rb
431
426
  - lib/good_job/cron_manager.rb
432
427
  - lib/good_job/current_thread.rb
433
428
  - lib/good_job/daemon.rb
@@ -435,9 +430,7 @@ files:
435
430
  - lib/good_job/engine.rb
436
431
  - lib/good_job/execution_result.rb
437
432
  - lib/good_job/filterable.rb
438
- - lib/good_job/job.rb
439
433
  - lib/good_job/job_performer.rb
440
- - lib/good_job/lockable.rb
441
434
  - lib/good_job/log_subscriber.rb
442
435
  - lib/good_job/multi_scheduler.rb
443
436
  - lib/good_job/notifier.rb
@@ -448,7 +441,10 @@ files:
448
441
  - lib/good_job/version.rb
449
442
  - lib/models/good_job/active_job_job.rb
450
443
  - lib/models/good_job/base_record.rb
444
+ - lib/models/good_job/cron_entry.rb
451
445
  - lib/models/good_job/execution.rb
446
+ - lib/models/good_job/job.rb
447
+ - lib/models/good_job/lockable.rb
452
448
  - lib/models/good_job/process.rb
453
449
  homepage: https://github.com/bensheldon/good_job
454
450
  licenses:
@@ -460,7 +456,7 @@ metadata:
460
456
  homepage_uri: https://github.com/bensheldon/good_job
461
457
  source_code_uri: https://github.com/bensheldon/good_job
462
458
  rubygems_mfa_required: 'true'
463
- post_install_message:
459
+ post_install_message:
464
460
  rdoc_options:
465
461
  - "--title"
466
462
  - GoodJob - a multithreaded, Postgres-based ActiveJob backend for Ruby on Rails
@@ -482,8 +478,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
482
478
  - !ruby/object:Gem::Version
483
479
  version: '0'
484
480
  requirements: []
485
- rubygems_version: 3.3.16
486
- signing_key:
481
+ rubygems_version: 3.1.6
482
+ signing_key:
487
483
  specification_version: 4
488
484
  summary: A multithreaded, Postgres-based ActiveJob backend for Ruby on Rails
489
485
  test_files: []
@@ -1,14 +0,0 @@
1
- # frozen_string_literal: true
2
- class AddCronAtToGoodJobs < ActiveRecord::Migration<%= migration_version %>
3
- def change
4
- reversible do |dir|
5
- dir.up do
6
- # Ensure this incremental update migration is idempotent
7
- # with monolithic install migration.
8
- return if connection.column_exists?(:good_jobs, :cron_at)
9
- end
10
- end
11
-
12
- add_column :good_jobs, :cron_at, :timestamp
13
- end
14
- end
@@ -1,20 +0,0 @@
1
- # frozen_string_literal: true
2
- class AddCronKeyCronAtIndexToGoodJobs < ActiveRecord::Migration<%= migration_version %>
3
- disable_ddl_transaction!
4
-
5
- def change
6
- reversible do |dir|
7
- dir.up do
8
- # Ensure this incremental update migration is idempotent
9
- # with monolithic install migration.
10
- return if connection.index_name_exists?(:good_jobs, :index_good_jobs_on_cron_key_and_cron_at)
11
- end
12
- end
13
-
14
- add_index :good_jobs,
15
- [:cron_key, :cron_at],
16
- algorithm: :concurrently,
17
- name: :index_good_jobs_on_cron_key_and_cron_at,
18
- unique: true
19
- end
20
- end
@@ -1,17 +0,0 @@
1
- # frozen_string_literal: true
2
- class CreateGoodJobProcesses < ActiveRecord::Migration<%= migration_version %>
3
- def change
4
- reversible do |dir|
5
- dir.up do
6
- # Ensure this incremental update migration is idempotent
7
- # with monolithic install migration.
8
- return if connection.table_exists?(:good_job_processes)
9
- end
10
- end
11
-
12
- create_table :good_job_processes, id: :uuid do |t|
13
- t.timestamps
14
- t.jsonb :state
15
- end
16
- end
17
- end
@@ -1,25 +0,0 @@
1
- # frozen_string_literal: true
2
- class IndexGoodJobJobsOnFinishedAt < ActiveRecord::Migration<%= migration_version %>
3
- disable_ddl_transaction!
4
-
5
- def change
6
- reversible do |dir|
7
- dir.up do
8
- # Ensure this incremental update migration is idempotent
9
- # with monolithic install migration.
10
- return if connection.index_name_exists?(:good_jobs, :index_good_jobs_on_active_job_id)
11
- end
12
- end
13
-
14
- add_index :good_jobs,
15
- [:active_job_id],
16
- name: :index_good_jobs_on_active_job_id,
17
- algorithm: :concurrently
18
-
19
- add_index :good_jobs,
20
- [:finished_at],
21
- where: "retried_good_job_id IS NULL AND finished_at IS NOT NULL",
22
- name: :index_good_jobs_jobs_on_finished_at,
23
- algorithm: :concurrently
24
- end
25
- end
data/lib/good_job/job.rb DELETED
@@ -1,11 +0,0 @@
1
- # frozen_string_literal: true
2
- module GoodJob
3
- # @deprecated Use {GoodJob::Execution} instead.
4
- class Job < Execution
5
- after_initialize do |_job|
6
- ActiveSupport::Deprecation.warn(
7
- "The `GoodJob::Job` class name is deprecated. Replace with `GoodJob::Execution`."
8
- )
9
- end
10
- end
11
- end