good_job 3.99.0 → 4.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 (60) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +21 -0
  3. data/app/charts/good_job/scheduled_by_queue_chart.rb +2 -2
  4. data/app/controllers/good_job/cron_entries_controller.rb +0 -8
  5. data/app/controllers/good_job/metrics_controller.rb +1 -1
  6. data/app/controllers/good_job/performance_controller.rb +19 -0
  7. data/app/models/concerns/good_job/filterable.rb +1 -1
  8. data/app/models/good_job/base_execution.rb +104 -201
  9. data/app/models/good_job/cron_entry.rb +0 -2
  10. data/app/models/good_job/discrete_execution.rb +1 -31
  11. data/app/models/good_job/execution.rb +3 -7
  12. data/app/models/good_job/job.rb +37 -116
  13. data/app/models/good_job/process.rb +7 -20
  14. data/app/views/good_job/batches/index.html.erb +11 -15
  15. data/app/views/good_job/jobs/_executions.erb +1 -1
  16. data/app/views/good_job/jobs/_table.erb +1 -1
  17. data/app/views/good_job/jobs/show.html.erb +1 -8
  18. data/app/views/good_job/performance/index.html.erb +43 -0
  19. data/app/views/good_job/shared/_navbar.erb +2 -2
  20. data/config/locales/de.yml +4 -7
  21. data/config/locales/en.yml +4 -7
  22. data/config/locales/es.yml +4 -7
  23. data/config/locales/fr.yml +4 -7
  24. data/config/locales/it.yml +4 -7
  25. data/config/locales/ja.yml +4 -7
  26. data/config/locales/ko.yml +4 -7
  27. data/config/locales/nl.yml +4 -7
  28. data/config/locales/pt-BR.yml +4 -7
  29. data/config/locales/ru.yml +4 -7
  30. data/config/locales/tr.yml +4 -7
  31. data/config/locales/uk.yml +4 -7
  32. data/config/routes.rb +1 -1
  33. data/lib/generators/good_job/templates/update/migrations/01_create_good_jobs.rb.erb +65 -3
  34. data/lib/good_job/active_job_extensions/batches.rb +1 -1
  35. data/lib/good_job/active_job_extensions/concurrency.rb +10 -10
  36. data/lib/good_job/adapter.rb +13 -24
  37. data/lib/good_job/configuration.rb +5 -1
  38. data/lib/good_job/current_thread.rb +6 -6
  39. data/lib/good_job/job_performer.rb +2 -2
  40. data/lib/good_job/log_subscriber.rb +2 -10
  41. data/lib/good_job/notifier.rb +3 -3
  42. data/lib/good_job/version.rb +1 -1
  43. data/lib/good_job.rb +16 -21
  44. metadata +18 -32
  45. data/app/controllers/good_job/performances_controller.rb +0 -23
  46. data/app/views/good_job/performances/show.html.erb +0 -50
  47. data/lib/generators/good_job/templates/update/migrations/02_create_good_job_settings.rb.erb +0 -20
  48. data/lib/generators/good_job/templates/update/migrations/03_create_index_good_jobs_jobs_on_priority_created_at_when_unfinished.rb.erb +0 -19
  49. data/lib/generators/good_job/templates/update/migrations/04_create_good_job_batches.rb.erb +0 -35
  50. data/lib/generators/good_job/templates/update/migrations/05_create_good_job_executions.rb.erb +0 -33
  51. data/lib/generators/good_job/templates/update/migrations/06_create_good_jobs_error_event.rb.erb +0 -16
  52. data/lib/generators/good_job/templates/update/migrations/07_recreate_good_job_cron_indexes_with_conditional.rb.erb +0 -45
  53. data/lib/generators/good_job/templates/update/migrations/08_create_good_job_labels.rb.erb +0 -15
  54. data/lib/generators/good_job/templates/update/migrations/09_create_good_job_labels_index.rb.erb +0 -22
  55. data/lib/generators/good_job/templates/update/migrations/10_remove_good_job_active_id_index.rb.erb +0 -21
  56. data/lib/generators/good_job/templates/update/migrations/11_create_index_good_job_jobs_for_candidate_lookup.rb.erb +0 -19
  57. data/lib/generators/good_job/templates/update/migrations/12_create_good_job_execution_error_backtrace.rb.erb +0 -15
  58. data/lib/generators/good_job/templates/update/migrations/13_create_good_job_process_lock_ids.rb.erb +0 -18
  59. data/lib/generators/good_job/templates/update/migrations/14_create_good_job_process_lock_indexes.rb.erb +0 -38
  60. data/lib/generators/good_job/templates/update/migrations/15_create_good_job_execution_duration.rb.erb +0 -15
@@ -1,18 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- class CreateGoodJobProcessLockIds < ActiveRecord::Migration<%= migration_version %>
4
- def change
5
- reversible do |dir|
6
- dir.up do
7
- # Ensure this incremental update migration is idempotent
8
- # with monolithic install migration.
9
- return if connection.column_exists?(:good_jobs, :locked_by_id)
10
- end
11
- end
12
-
13
- add_column :good_jobs, :locked_by_id, :uuid
14
- add_column :good_jobs, :locked_at, :datetime
15
- add_column :good_job_executions, :process_id, :uuid
16
- add_column :good_job_processes, :lock_type, :integer, limit: 2
17
- end
18
- end
@@ -1,38 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- class CreateGoodJobProcessLockIndexes < ActiveRecord::Migration<%= migration_version %>
4
- disable_ddl_transaction!
5
-
6
- def change
7
- reversible do |dir|
8
- dir.up do
9
- unless connection.index_name_exists?(:good_jobs, :index_good_jobs_on_priority_scheduled_at_unfinished_unlocked)
10
- add_index :good_jobs, [:priority, :scheduled_at],
11
- order: { priority: "ASC NULLS LAST", scheduled_at: :asc },
12
- where: "finished_at IS NULL AND locked_by_id IS NULL",
13
- name: :index_good_jobs_on_priority_scheduled_at_unfinished_unlocked,
14
- algorithm: :concurrently
15
- end
16
-
17
- unless connection.index_name_exists?(:good_jobs, :index_good_jobs_on_locked_by_id)
18
- add_index :good_jobs, :locked_by_id,
19
- where: "locked_by_id IS NOT NULL",
20
- name: :index_good_jobs_on_locked_by_id,
21
- algorithm: :concurrently
22
- end
23
-
24
- unless connection.index_name_exists?(:good_job_executions, :index_good_job_executions_on_process_id_and_created_at)
25
- add_index :good_job_executions, [:process_id, :created_at],
26
- name: :index_good_job_executions_on_process_id_and_created_at,
27
- algorithm: :concurrently
28
- end
29
- end
30
-
31
- dir.down do
32
- remove_index(:good_jobs, name: :index_good_jobs_on_priority_scheduled_at_unfinished_unlocked) if connection.index_name_exists?(:good_jobs, :index_good_jobs_on_priority_scheduled_at_unfinished_unlocked)
33
- remove_index(:good_jobs, name: :index_good_jobs_on_locked_by_id) if connection.index_name_exists?(:good_jobs, :index_good_jobs_on_locked_by_id)
34
- remove_index(:good_job_executions, name: :index_good_job_executions_on_process_id_and_created_at) if connection.index_name_exists?(:good_job_executions, :index_good_job_executions_on_process_id_and_created_at)
35
- end
36
- end
37
- end
38
- end
@@ -1,15 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- class CreateGoodJobExecutionDuration < ActiveRecord::Migration<%= migration_version %>
4
- def change
5
- reversible do |dir|
6
- dir.up do
7
- # Ensure this incremental update migration is idempotent
8
- # with monolithic install migration.
9
- return if connection.column_exists?(:good_job_executions, :duration)
10
- end
11
- end
12
-
13
- add_column :good_job_executions, :duration, :interval
14
- end
15
- end