good_job 4.11.1 → 4.12.0
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 +4 -4
- data/CHANGELOG.md +52 -1
- data/README.md +1 -1
- data/app/controllers/good_job/jobs_controller.rb +2 -1
- data/app/filters/good_job/base_filter.rb +1 -1
- data/app/models/good_job/batch_record.rb +2 -2
- data/app/models/good_job/job.rb +3 -3
- data/app/models/good_job/setting.rb +3 -3
- data/app/views/good_job/cron_entries/index.html.erb +18 -9
- data/app/views/good_job/processes/index.html.erb +4 -4
- data/app/views/good_job/shared/_secondary_navbar.erb +2 -2
- data/app/views/layouts/good_job/application.html.erb +7 -5
- data/config/brakeman.ignore +26 -3
- data/config/locales/de.yml +4 -0
- data/config/locales/en.yml +4 -0
- data/config/locales/es.yml +4 -0
- data/config/locales/fr.yml +4 -0
- data/config/locales/it.yml +4 -0
- data/config/locales/ja.yml +4 -0
- data/config/locales/ko.yml +4 -0
- data/config/locales/nl.yml +4 -0
- data/config/locales/pt-BR.yml +4 -0
- data/config/locales/ru.yml +4 -0
- data/config/locales/tr.yml +4 -0
- data/config/locales/uk.yml +4 -0
- data/exe/good_job +0 -1
- data/lib/generators/good_job/templates/install/migrations/create_good_jobs.rb.erb +1 -0
- data/lib/generators/good_job/templates/update/migrations/04_add_index_good_jobs_job_class.rb.erb +17 -0
- data/lib/good_job/capsule.rb +1 -3
- data/lib/good_job/cli.rb +7 -2
- data/lib/good_job/engine.rb +0 -1
- data/lib/good_job/log_subscriber.rb +1 -3
- data/lib/good_job/scheduler.rb +1 -3
- data/lib/good_job/version.rb +1 -1
- data/lib/good_job.rb +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f8d2230721300457a34764edf4b7b05a7c2e1e58931186a594b505f13c3a35f0
|
4
|
+
data.tar.gz: 9330aa1ed9b6fea281bbe9cf95c6a46d96f6eb670b12041d113fb56c89228d87
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a545269af550ef4a99d353d2fa0f08c60c002651682dc58b831a85a63aff0703506c19047230d09572de99810c4754e184ec2fcb852429f84330fdde70e855ba
|
7
|
+
data.tar.gz: cc75f90006b8e24237759f5648ff78a3799c5a67b055df61c73dcc1f71f2cc7b40e3a60f7898f7688609ec677587fe7fd11762a7dbcaa3af75d33319e8f08c58
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,56 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## [v4.12.0](https://github.com/bensheldon/good_job/tree/v4.12.0) (2025-09-22)
|
4
|
+
|
5
|
+
[Full Changelog](https://github.com/bensheldon/good_job/compare/v4.11.2...v4.12.0)
|
6
|
+
|
7
|
+
**Implemented enhancements:**
|
8
|
+
|
9
|
+
- Allow `GoodJob::Cli.log_to_stdout =` to be set by the parent application [\#1680](https://github.com/bensheldon/good_job/pull/1680) ([bensheldon](https://github.com/bensheldon))
|
10
|
+
- Optimize job\_class scope performance by using column instead of JSON extraction [\#1672](https://github.com/bensheldon/good_job/pull/1672) ([ScotterC](https://github.com/ScotterC))
|
11
|
+
- Add state column to cron entries table [\#1652](https://github.com/bensheldon/good_job/pull/1652) ([gregplumbly](https://github.com/gregplumbly))
|
12
|
+
|
13
|
+
**Fixed bugs:**
|
14
|
+
|
15
|
+
- Reorganize Dashboard header, ensure favicon svg is encoded; fix double mt-auto [\#1668](https://github.com/bensheldon/good_job/pull/1668) ([bensheldon](https://github.com/bensheldon))
|
16
|
+
|
17
|
+
**Closed issues:**
|
18
|
+
|
19
|
+
- GoodJob Cron unique index [\#1678](https://github.com/bensheldon/good_job/issues/1678)
|
20
|
+
- params\_job\_class JSON extraction causing performance issues - why not use job\_class column? [\#1671](https://github.com/bensheldon/good_job/issues/1671)
|
21
|
+
- Good Job process stalling and CPU at 100% [\#1669](https://github.com/bensheldon/good_job/issues/1669)
|
22
|
+
|
23
|
+
**Merged pull requests:**
|
24
|
+
|
25
|
+
- Update sorbet/tapioca [\#1681](https://github.com/bensheldon/good_job/pull/1681) ([bensheldon](https://github.com/bensheldon))
|
26
|
+
- Remove obsolete property from tests [\#1676](https://github.com/bensheldon/good_job/pull/1676) ([RDIL](https://github.com/RDIL))
|
27
|
+
- Bump actions/checkout from 4 to 5 [\#1673](https://github.com/bensheldon/good_job/pull/1673) ([dependabot[bot]](https://github.com/apps/dependabot))
|
28
|
+
|
29
|
+
## [v4.11.2](https://github.com/bensheldon/good_job/tree/v4.11.2) (2025-08-06)
|
30
|
+
|
31
|
+
[Full Changelog](https://github.com/bensheldon/good_job/compare/v4.11.1...v4.11.2)
|
32
|
+
|
33
|
+
**Implemented enhancements:**
|
34
|
+
|
35
|
+
- Add a favicon [\#1664](https://github.com/bensheldon/good_job/pull/1664) ([itsalongstory](https://github.com/itsalongstory))
|
36
|
+
|
37
|
+
**Fixed bugs:**
|
38
|
+
|
39
|
+
- UI: Add `.text-wrap` to the Cron Entry key [\#1667](https://github.com/bensheldon/good_job/pull/1667) ([seanpdoyle](https://github.com/seanpdoyle))
|
40
|
+
- Fix duplicate parameters [\#1648](https://github.com/bensheldon/good_job/pull/1648) ([itsalongstory](https://github.com/itsalongstory))
|
41
|
+
|
42
|
+
**Closed issues:**
|
43
|
+
|
44
|
+
- проблема с вб [\#1665](https://github.com/bensheldon/good_job/issues/1665)
|
45
|
+
|
46
|
+
**Merged pull requests:**
|
47
|
+
|
48
|
+
- Docufix: correct connects\_to statement for multiple databases setup [\#1663](https://github.com/bensheldon/good_job/pull/1663) ([amo13](https://github.com/amo13))
|
49
|
+
- Update development dependencies and Rubocop [\#1662](https://github.com/bensheldon/good_job/pull/1662) ([bensheldon](https://github.com/bensheldon))
|
50
|
+
- Remove circular dependency of requiring good\_job in engine [\#1655](https://github.com/bensheldon/good_job/pull/1655) ([bensheldon](https://github.com/bensheldon))
|
51
|
+
- Render the current time according to the Rails application's time zone setting. [\#1650](https://github.com/bensheldon/good_job/pull/1650) ([itsalongstory](https://github.com/itsalongstory))
|
52
|
+
- Make the processes page more responsive by extracting queues and max\_threads [\#1647](https://github.com/bensheldon/good_job/pull/1647) ([luizkowalski](https://github.com/luizkowalski))
|
53
|
+
|
3
54
|
## [v4.11.1](https://github.com/bensheldon/good_job/tree/v4.11.1) (2025-06-30)
|
4
55
|
|
5
56
|
[Full Changelog](https://github.com/bensheldon/good_job/compare/v4.11.0...v4.11.1)
|
@@ -999,7 +1050,7 @@
|
|
999
1050
|
|
1000
1051
|
**Fixed bugs:**
|
1001
1052
|
|
1002
|
-
- Skip `RecordAlreadyAdvisoryLockedError` during mass-update action [\#1158](https://github.com/bensheldon/good_job/pull/1158) ([
|
1053
|
+
- Skip `RecordAlreadyAdvisoryLockedError` during mass-update action [\#1158](https://github.com/bensheldon/good_job/pull/1158) ([justinallenmarsh](https://github.com/justinallenmarsh))
|
1003
1054
|
|
1004
1055
|
**Closed issues:**
|
1005
1056
|
|
data/README.md
CHANGED
@@ -358,7 +358,7 @@ Good Job’s general behavior can also be configured via attributes directly on
|
|
358
358
|
```ruby
|
359
359
|
# config/initializers/good_job.rb
|
360
360
|
GoodJob.configure_active_record do
|
361
|
-
connects_to database: :special_database
|
361
|
+
connects_to database: { writing: :special_database }
|
362
362
|
self.table_name_prefix = "special_application_"
|
363
363
|
end
|
364
364
|
```
|
@@ -97,7 +97,8 @@ module GoodJob
|
|
97
97
|
def redirect_to_index
|
98
98
|
# Redirect to the jobs page, maintaining query parameters. This is
|
99
99
|
# necessary to support the `?poll=1` parameter that enables live polling.
|
100
|
-
|
100
|
+
# But `locale` will be set by `default_url_options`.
|
101
|
+
redirect_to jobs_path(request.query_parameters.except("locale"))
|
101
102
|
end
|
102
103
|
|
103
104
|
private
|
@@ -67,14 +67,14 @@ module GoodJob
|
|
67
67
|
on_discard.constantize.set(priority: callback_priority, queue: callback_queue_name).perform_later(to_batch, { event: :discard }) if on_discard.present?
|
68
68
|
end
|
69
69
|
|
70
|
-
if enqueued_at && !(self.class.jobs_finished_at_migrated? ? jobs_finished_at : finished_at) && jobs.where(finished_at: nil).
|
70
|
+
if enqueued_at && !(self.class.jobs_finished_at_migrated? ? jobs_finished_at : finished_at) && jobs.where(finished_at: nil).none?
|
71
71
|
self.class.jobs_finished_at_migrated? ? update(jobs_finished_at: Time.current) : update(finished_at: Time.current)
|
72
72
|
|
73
73
|
on_success.constantize.set(priority: callback_priority, queue: callback_queue_name).perform_later(to_batch, { event: :success }) if !discarded_at && on_success.present?
|
74
74
|
on_finish.constantize.set(priority: callback_priority, queue: callback_queue_name).perform_later(to_batch, { event: :finish }) if on_finish.present?
|
75
75
|
end
|
76
76
|
|
77
|
-
update(finished_at: Time.current) if !finished_at && self.class.jobs_finished_at_migrated? && jobs_finished? && callback_jobs.where(finished_at: nil).
|
77
|
+
update(finished_at: Time.current) if !finished_at && self.class.jobs_finished_at_migrated? && jobs_finished? && callback_jobs.where(finished_at: nil).none?
|
78
78
|
end
|
79
79
|
end
|
80
80
|
end
|
data/app/models/good_job/job.rb
CHANGED
@@ -239,7 +239,7 @@ module GoodJob
|
|
239
239
|
end
|
240
240
|
|
241
241
|
def params_job_class
|
242
|
-
|
242
|
+
arel_table[:job_class]
|
243
243
|
end
|
244
244
|
|
245
245
|
def params_execution_count
|
@@ -250,8 +250,8 @@ module GoodJob
|
|
250
250
|
)
|
251
251
|
end
|
252
252
|
|
253
|
-
def
|
254
|
-
return true if connection.index_name_exists?(:good_jobs, :
|
253
|
+
def job_class_index_migrated?
|
254
|
+
return true if connection.index_name_exists?(:good_jobs, :index_good_jobs_on_job_class)
|
255
255
|
|
256
256
|
migration_pending_warning!
|
257
257
|
false
|
@@ -50,7 +50,7 @@ module GoodJob
|
|
50
50
|
end
|
51
51
|
|
52
52
|
def self.pause(queue: nil, job_class: nil, label: nil)
|
53
|
-
raise ArgumentError, "Must provide exactly one of queue, job_class, or label" unless [queue, job_class, label].
|
53
|
+
raise ArgumentError, "Must provide exactly one of queue, job_class, or label" unless [queue, job_class, label].one?(&:present?)
|
54
54
|
|
55
55
|
setting = find_or_initialize_by(key: PAUSES) do |record|
|
56
56
|
record.value = { "queues" => [], "job_classes" => [], "labels" => [] }
|
@@ -70,7 +70,7 @@ module GoodJob
|
|
70
70
|
end
|
71
71
|
|
72
72
|
def self.unpause(queue: nil, job_class: nil, label: nil)
|
73
|
-
raise ArgumentError, "Must provide exactly one of queue, job_class, or label" unless [queue, job_class, label].
|
73
|
+
raise ArgumentError, "Must provide exactly one of queue, job_class, or label" unless [queue, job_class, label].one?(&:present?)
|
74
74
|
|
75
75
|
setting = find_by(key: PAUSES)
|
76
76
|
return unless setting
|
@@ -92,7 +92,7 @@ module GoodJob
|
|
92
92
|
end
|
93
93
|
|
94
94
|
def self.paused?(queue: nil, job_class: nil, label: nil)
|
95
|
-
raise ArgumentError, "Must provide at most one of queue, job_class, or label" if [queue, job_class, label].
|
95
|
+
raise ArgumentError, "Must provide at most one of queue, job_class, or label" if [queue, job_class, label].many?(&:present?)
|
96
96
|
|
97
97
|
if queue
|
98
98
|
queue.in? paused(:queues)
|
@@ -6,12 +6,13 @@
|
|
6
6
|
<div class="list-group list-group-flush text-nowrap" role="table">
|
7
7
|
<header class="list-group-item body-secondary">
|
8
8
|
<div class="row small text-muted text-uppercase align-items-center">
|
9
|
-
<div class="col-
|
10
|
-
<div class="col-
|
11
|
-
<div class="col-
|
12
|
-
<div class="col-
|
13
|
-
<div class="col-
|
14
|
-
<div class="col
|
9
|
+
<div class="col-lg-2"></div>
|
10
|
+
<div class="col-lg-2 d-none d-lg-block"><%= t "good_job.models.cron.class" %></div>
|
11
|
+
<div class="col-lg-2 d-none d-lg-block"><%= t "good_job.models.cron.schedule" %></div>
|
12
|
+
<div class="col-lg-2 d-none d-lg-block"><%= t "good_job.models.cron.next_scheduled" %></div>
|
13
|
+
<div class="col-lg-1 d-none d-lg-block"><%= t "good_job.models.cron.last_run" %></div>
|
14
|
+
<div class="col-lg-1 d-none d-lg-block"><%= t "good_job.models.cron.status" %></div>
|
15
|
+
<div class="col-lg-2 text-end">
|
15
16
|
<%= tag.button type: "button", class: "btn btn-sm text-muted", role: "button",
|
16
17
|
data: { bs_toggle: "collapse", bs_target: ".cron-entry-properties" },
|
17
18
|
aria: { expanded: false, controls: @cron_entries.map { |cron_entry| "##{dom_id(cron_entry, 'properties')}" }.join(" ") } do %>
|
@@ -25,7 +26,7 @@
|
|
25
26
|
<div id="<%= dom_id(cron_entry) %>" class="list-group-item py-3" role="row">
|
26
27
|
<div class="row align-items-center">
|
27
28
|
<div class="col-12 col-lg-2">
|
28
|
-
<div class="small font-monospace"><%= cron_entry.key %></div>
|
29
|
+
<div class="small font-monospace text-wrap"><%= cron_entry.key %></div>
|
29
30
|
<div class="small text-muted text-wrap"><%= cron_entry.description %></div>
|
30
31
|
</div>
|
31
32
|
<div class="col-12 col-lg-2 text-wrap"><%= tag.span tag.code(cron_entry.job_class), class: "fs-5 mb-0" %></div>
|
@@ -37,13 +38,21 @@
|
|
37
38
|
<div class="d-lg-none small text-muted mt-1"><%= t "good_job.models.cron.next_scheduled" %></div>
|
38
39
|
<%= relative_time cron_entry.next_at %>
|
39
40
|
</div>
|
40
|
-
<div class="col-6 col-lg-
|
41
|
+
<div class="col-6 col-lg-1 text-wrap small">
|
41
42
|
<% if cron_entry.last_job.present? %>
|
42
43
|
<div class="d-lg-none small text-muted mt-1"><%= t "good_job.models.cron.last_run" %></div>
|
43
44
|
<%= link_to relative_time(cron_entry.last_job_at), cron_entry_path(cron_entry), title: "Job #{cron_entry.last_job.id}" %>
|
44
45
|
<% end %>
|
45
46
|
</div>
|
46
|
-
<div class="col
|
47
|
+
<div class="col-6 col-lg-1 text-wrap small">
|
48
|
+
<div class="d-lg-none small text-muted mt-1"><%= t "good_job.models.cron.status" %></div>
|
49
|
+
<% if cron_entry.enabled? %>
|
50
|
+
<span class="text-success"><%= t "good_job.models.cron.states.active" %></span>
|
51
|
+
<% else %>
|
52
|
+
<span class="text-muted"><%= t "good_job.models.cron.states.paused" %></span>
|
53
|
+
<% end %>
|
54
|
+
</div>
|
55
|
+
<div class="col-lg-2 d-flex gap-3 justify-content-end">
|
47
56
|
<%= button_to enqueue_cron_entry_path(cron_entry), method: :post, class: "btn btn-sm btn-outline-primary", form_class: "d-inline-block", aria: { label: t("good_job.cron_entries.actions.enqueue") }, title: t("good_job.cron_entries.actions.enqueue"), data: { confirm: t("good_job.cron_entries.actions.confirm_enqueue") } do %>
|
48
57
|
<%= render_icon "skip_forward" %>
|
49
58
|
<% end %>
|
@@ -3,7 +3,7 @@
|
|
3
3
|
</div>
|
4
4
|
|
5
5
|
<div class="card my-3" data-live-poll-region="processes">
|
6
|
-
<div class="list-group list-group-flush
|
6
|
+
<div class="list-group list-group-flush" role="table">
|
7
7
|
<header class="list-group-item bg-body-tertiary">
|
8
8
|
<div class="row small text-muted text-uppercase align-items-center">
|
9
9
|
<div class="col"><%= t ".process" %></div>
|
@@ -41,9 +41,9 @@
|
|
41
41
|
<span class="badge rounded-pill bg-body-secondary text-secondary"><%= (process.state["memory"] / 1024).to_i %> MB</span>
|
42
42
|
</div>
|
43
43
|
</div>
|
44
|
-
<div class="col">
|
45
|
-
<% process.schedulers.each do |
|
46
|
-
<pre class="mb-0"
|
44
|
+
<div class="col mw-100">
|
45
|
+
<% process.schedulers.each do |scheduler_data| %>
|
46
|
+
<pre class="mb-0" title="<%= scheduler_data %>">queues=<%= scheduler_data["queues"] %> max_threads=<%= scheduler_data["max_threads"] %></pre>
|
47
47
|
<% end %>
|
48
48
|
</div>
|
49
49
|
<div class="col-2 small"><%= t(ActiveModel::Type::Boolean.new.cast(process.state["cron_enabled"]), scope: "good_job.shared.boolean") %></div>
|
@@ -1,10 +1,10 @@
|
|
1
|
-
<nav class="navbar p-1 shadow-sm
|
1
|
+
<nav class="navbar p-1 shadow-sm border-bottom text-muted small" id="secondary-navbar" data-live-poll-region="secondary-navbar">
|
2
2
|
<div class="container-fluid">
|
3
3
|
<div class="flex-fill d-none d-sm-block ">
|
4
4
|
<%= t(".inspiration") %>
|
5
5
|
</div>
|
6
6
|
<div class="flex-fill text-end">
|
7
|
-
<% last_updated_at = Time.current.
|
7
|
+
<% last_updated_at = Time.current.to_s %>
|
8
8
|
<%= t(".last_updated") %> <time id="page-updated-at" datetime="<%= last_updated_at %>"><%= last_updated_at %></time>
|
9
9
|
</div>
|
10
10
|
</div>
|
@@ -1,24 +1,21 @@
|
|
1
1
|
<!DOCTYPE html>
|
2
2
|
<html lang="<%= I18n.locale %>" data-bs-theme="auto">
|
3
3
|
<head>
|
4
|
-
<title>Good Job Dashboard</title>
|
5
4
|
<meta charset="utf-8">
|
6
5
|
<meta content="width=device-width, initial-scale=1, shrink-to-fit=no" name="viewport">
|
7
|
-
<%= csrf_meta_tags %>
|
8
|
-
<%= csp_meta_tag %>
|
9
6
|
|
10
7
|
<%# Bootstrap Color Modes
|
11
8
|
"It is suggested to include the JavaScript at the top of your page
|
12
9
|
to reduce potential screen flickering during reloading of your site."
|
13
10
|
https://getbootstrap.com/docs/5.3/customize/color-modes/#javascript
|
14
11
|
%>
|
15
|
-
|
12
|
+
<script nonce="<%= content_security_policy_nonce %>">
|
16
13
|
let theme = localStorage.getItem('good_job-theme');
|
17
14
|
if (!["light", "dark"].includes(theme)) {
|
18
15
|
theme = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
|
19
16
|
}
|
20
17
|
document.documentElement.setAttribute('data-bs-theme', theme);
|
21
|
-
|
18
|
+
</script>
|
22
19
|
|
23
20
|
<%# Do not use asset tag helpers to avoid paths being overriden by config.asset_host %>
|
24
21
|
<%= tag.link rel: "stylesheet", href: frontend_static_path(:bootstrap, format: :css, locale: nil), nonce: content_security_policy_nonce %>
|
@@ -30,6 +27,11 @@
|
|
30
27
|
<% importmaps = GoodJob::FrontendsController.js_modules.keys.index_with { |module_name| frontend_module_path(module_name, format: :js, locale: nil) } %>
|
31
28
|
<%= tag.script({ imports: importmaps }.to_json.html_safe, type: "importmap", nonce: content_security_policy_nonce) %>
|
32
29
|
<%= tag.script "", type: "module", nonce: content_security_policy_nonce do %> import "application"; <% end %>
|
30
|
+
|
31
|
+
<title>Good Job Dashboard</title>
|
32
|
+
<%= tag.link rel: "icon", href: 'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="10 0 100 100"><text y=".90em" font-size="90">👍</text></svg>' %>
|
33
|
+
<%= csrf_meta_tags %>
|
34
|
+
<%= csp_meta_tag %>
|
33
35
|
</head>
|
34
36
|
<body>
|
35
37
|
<div class="d-flex flex-column min-vh-100">
|
data/config/brakeman.ignore
CHANGED
@@ -46,6 +46,30 @@
|
|
46
46
|
],
|
47
47
|
"note": "Files are explicitly enumerated in the array"
|
48
48
|
},
|
49
|
+
{
|
50
|
+
"warning_type": "Dangerous Eval",
|
51
|
+
"warning_code": 13,
|
52
|
+
"fingerprint": "c4c3e1b8b28ebbfd4672cf3e8f0022a27aff3c12dc4fea750b412de1387f91e6",
|
53
|
+
"check_name": "Evaluation",
|
54
|
+
"message": "Dynamic string evaluated as code",
|
55
|
+
"file": "lib/good_job/log_subscriber.rb",
|
56
|
+
"line": 256,
|
57
|
+
"link": "https://brakemanscanner.org/docs/warning_types/dangerous_eval/",
|
58
|
+
"code": "class_eval(\" def #{level}(progname = nil, tags: [], &block) # def info(progname = nil, tags: [], &block)\\n return unless logger # return unless logger\\n #\\n tag_logger(*tags) do # tag_logger(*tags) do\\n logger.#{level}(progname, &block) # logger.info(progname, &block)\\n end # end\\n end #\\n\", \"lib/good_job/log_subscriber.rb\", (256 + 1))",
|
59
|
+
"render_path": null,
|
60
|
+
"location": {
|
61
|
+
"type": "method",
|
62
|
+
"class": "LogSubscriber",
|
63
|
+
"method": null
|
64
|
+
},
|
65
|
+
"user_input": null,
|
66
|
+
"confidence": "Weak",
|
67
|
+
"cwe_id": [
|
68
|
+
913,
|
69
|
+
95
|
70
|
+
],
|
71
|
+
"note": ""
|
72
|
+
},
|
49
73
|
{
|
50
74
|
"warning_type": "SQL Injection",
|
51
75
|
"warning_code": 0,
|
@@ -53,7 +77,7 @@
|
|
53
77
|
"check_name": "SQL",
|
54
78
|
"message": "Possible SQL injection",
|
55
79
|
"file": "app/models/good_job/job.rb",
|
56
|
-
"line":
|
80
|
+
"line": 162,
|
57
81
|
"link": "https://brakemanscanner.org/docs/warning_types/sql_injection/",
|
58
82
|
"code": "Arel.sql(\"(CASE #{queues.map.with_index do\n sanitize_sql_array([\"WHEN queue_name = ? THEN ?\", queue_name, index])\n end.join(\" \")} ELSE #{queues.size} END)\")",
|
59
83
|
"render_path": null,
|
@@ -93,6 +117,5 @@
|
|
93
117
|
"note": ""
|
94
118
|
}
|
95
119
|
],
|
96
|
-
"
|
97
|
-
"brakeman_version": "6.2.1"
|
120
|
+
"brakeman_version": "7.0.2"
|
98
121
|
}
|
data/config/locales/de.yml
CHANGED
data/config/locales/en.yml
CHANGED
data/config/locales/es.yml
CHANGED
data/config/locales/fr.yml
CHANGED
data/config/locales/it.yml
CHANGED
data/config/locales/ja.yml
CHANGED
data/config/locales/ko.yml
CHANGED
data/config/locales/nl.yml
CHANGED
data/config/locales/pt-BR.yml
CHANGED
data/config/locales/ru.yml
CHANGED
data/config/locales/tr.yml
CHANGED
data/config/locales/uk.yml
CHANGED
data/exe/good_job
CHANGED
@@ -92,6 +92,7 @@ class CreateGoodJobs < ActiveRecord::Migration<%= migration_version %>
|
|
92
92
|
where: "finished_at IS NULL", name: :index_good_job_jobs_for_candidate_lookup
|
93
93
|
add_index :good_jobs, [:batch_id], where: "batch_id IS NOT NULL"
|
94
94
|
add_index :good_jobs, [:batch_callback_id], where: "batch_callback_id IS NOT NULL"
|
95
|
+
add_index :good_jobs, :job_class, name: :index_good_jobs_on_job_class
|
95
96
|
add_index :good_jobs, :labels, using: :gin, where: "(labels IS NOT NULL)", name: :index_good_jobs_on_labels
|
96
97
|
|
97
98
|
add_index :good_job_executions, [:active_job_id, :created_at], name: :index_good_job_executions_on_active_job_id_and_created_at
|
data/lib/generators/good_job/templates/update/migrations/04_add_index_good_jobs_job_class.rb.erb
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class AddIndexGoodJobsJobClass < ActiveRecord::Migration<%= migration_version %>
|
4
|
+
disable_ddl_transaction!
|
5
|
+
|
6
|
+
def change
|
7
|
+
reversible do |dir|
|
8
|
+
dir.up do
|
9
|
+
# Ensure this incremental update migration is idempotent
|
10
|
+
# with monolithic install migration.
|
11
|
+
return if connection.index_exists? :good_jobs, :job_class
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
add_index :good_jobs, :job_class, algorithm: :concurrently
|
16
|
+
end
|
17
|
+
end
|
data/lib/good_job/capsule.rb
CHANGED
@@ -109,9 +109,7 @@ module GoodJob
|
|
109
109
|
|
110
110
|
# UUID for this capsule; to be used for inspection (not directly for locking jobs).
|
111
111
|
# @return [String]
|
112
|
-
|
113
|
-
@tracker.process_id
|
114
|
-
end
|
112
|
+
delegate :process_id, to: :@tracker
|
115
113
|
|
116
114
|
def lower_thread_priority=(value)
|
117
115
|
@lower_thread_priority = value
|
data/lib/good_job/cli.rb
CHANGED
@@ -29,10 +29,15 @@ module GoodJob
|
|
29
29
|
attr_accessor :within_exe
|
30
30
|
alias within_exe? within_exe
|
31
31
|
|
32
|
-
# Whether
|
32
|
+
# Whether the CLI's default logger should log to STDOUT.
|
33
33
|
# @return [Boolean, nil]
|
34
34
|
attr_accessor :log_to_stdout
|
35
|
-
|
35
|
+
|
36
|
+
# Whether the CLI's default logger logs to STDOUT.
|
37
|
+
# @return [Boolean, nil]
|
38
|
+
def log_to_stdout?
|
39
|
+
GoodJob::CLI.log_to_stdout.nil? ? GoodJob::CLI.within_exe? : GoodJob::CLI.log_to_stdout
|
40
|
+
end
|
36
41
|
|
37
42
|
# @!visibility private
|
38
43
|
def exit_on_failure?
|
data/lib/good_job/engine.rb
CHANGED
@@ -175,9 +175,7 @@ module GoodJob
|
|
175
175
|
|
176
176
|
# Get the logger associated with this {LogSubscriber} instance.
|
177
177
|
# @return [Logger]
|
178
|
-
|
179
|
-
GoodJob::LogSubscriber.logger
|
180
|
-
end
|
178
|
+
delegate :logger, to: :'GoodJob::LogSubscriber'
|
181
179
|
|
182
180
|
class << self
|
183
181
|
# Tracks all loggers that {LogSubscriber} is writing to. You can write to
|
data/lib/good_job/scheduler.rb
CHANGED
@@ -340,9 +340,7 @@ module GoodJob # :nodoc:
|
|
340
340
|
class TimerSet < ::Concurrent::TimerSet
|
341
341
|
# Number of scheduled jobs in the queue
|
342
342
|
# @return [Integer]
|
343
|
-
|
344
|
-
@queue.length
|
345
|
-
end
|
343
|
+
delegate :length, to: :@queue
|
346
344
|
|
347
345
|
# Clear the queue
|
348
346
|
# @return [void]
|
data/lib/good_job/version.rb
CHANGED
data/lib/good_job.rb
CHANGED
@@ -290,7 +290,7 @@ module GoodJob
|
|
290
290
|
# For use in tests/CI to validate GoodJob is up-to-date.
|
291
291
|
# @return [Boolean]
|
292
292
|
def self.migrated?
|
293
|
-
GoodJob::Job.
|
293
|
+
GoodJob::Job.job_class_index_migrated?
|
294
294
|
end
|
295
295
|
|
296
296
|
# Pause job execution for a given queue or job class.
|
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.
|
4
|
+
version: 4.12.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Sheldon
|
8
8
|
bindir: exe
|
9
9
|
cert_chain: []
|
10
|
-
date:
|
10
|
+
date: 1980-01-02 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
|
244
243
|
- CHANGELOG.md
|
245
244
|
- LICENSE.txt
|
245
|
+
- README.md
|
246
246
|
files:
|
247
247
|
- CHANGELOG.md
|
248
248
|
- LICENSE.txt
|
@@ -349,6 +349,7 @@ files:
|
|
349
349
|
- lib/generators/good_job/templates/update/migrations/01_create_good_jobs.rb.erb
|
350
350
|
- lib/generators/good_job/templates/update/migrations/02_add_jobs_finished_at_to_good_job_batches.rb.erb
|
351
351
|
- lib/generators/good_job/templates/update/migrations/03_add_index_good_jobs_concurrency_key_created_at.rb.erb
|
352
|
+
- lib/generators/good_job/templates/update/migrations/04_add_index_good_jobs_job_class.rb.erb
|
352
353
|
- lib/generators/good_job/update_generator.rb
|
353
354
|
- lib/good_job.rb
|
354
355
|
- lib/good_job/active_job_extensions/batches.rb
|
@@ -421,7 +422,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
421
422
|
- !ruby/object:Gem::Version
|
422
423
|
version: '0'
|
423
424
|
requirements: []
|
424
|
-
rubygems_version: 3.
|
425
|
+
rubygems_version: 3.7.2
|
425
426
|
specification_version: 4
|
426
427
|
summary: A multithreaded, Postgres-based ActiveJob backend for Ruby on Rails
|
427
428
|
test_files: []
|