good_job 3.26.1 → 3.26.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +17 -0
- data/app/controllers/good_job/metrics_controller.rb +25 -0
- data/app/frontend/good_job/application.js +2 -0
- data/app/frontend/good_job/modules/async_values_controller.js +31 -0
- data/app/views/good_job/shared/_navbar.erb +5 -9
- data/config/locales/fr.yml +4 -4
- data/config/routes.rb +1 -0
- data/lib/good_job/version.rb +1 -1
- data/lib/good_job.rb +38 -38
- metadata +8 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cd8ee28330829da54e9a3aa54e26b346c5a36749cadbe957871e800d7cd896fd
|
4
|
+
data.tar.gz: 42fd6406fafafff7a8635908db73c8a4159db1e86178551e1245d81c6485e943
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1b63f85473716cc66d12ff3886c3968606c0e6eff11d43b9ea49524419ba6f55841d3662660169712a5aca1b7715c9c50a9927626bc3416d495634864082effd
|
7
|
+
data.tar.gz: 83d2f99ca7aa3357af7625adbf05ab970b64fa9d6145d865ae045c737e7c8637e31b2da878e710db29feb2cf04a9dc63388663067bb096a6e2495e3d16b03367
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,22 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## [v3.26.2](https://github.com/bensheldon/good_job/tree/v3.26.2) (2024-03-15)
|
4
|
+
|
5
|
+
[Full Changelog](https://github.com/bensheldon/good_job/compare/v3.26.1...v3.26.2)
|
6
|
+
|
7
|
+
**Closed issues:**
|
8
|
+
|
9
|
+
- Async mode blocks ActionDispatch::Reloader [\#1274](https://github.com/bensheldon/good_job/issues/1274)
|
10
|
+
|
11
|
+
**Merged pull requests:**
|
12
|
+
|
13
|
+
- Update dependencies and their Sorbet / Tapioca files [\#1284](https://github.com/bensheldon/good_job/pull/1284) ([bensheldon](https://github.com/bensheldon))
|
14
|
+
- Use require\_relative and do not modify $LOAD\_PATH in gemspec [\#1283](https://github.com/bensheldon/good_job/pull/1283) ([bensheldon](https://github.com/bensheldon))
|
15
|
+
- Tweak rbtrace script [\#1279](https://github.com/bensheldon/good_job/pull/1279) ([bensheldon](https://github.com/bensheldon))
|
16
|
+
- Fix for Rails head: Don't try to override connection on connection checkin in tests [\#1277](https://github.com/bensheldon/good_job/pull/1277) ([bensheldon](https://github.com/bensheldon))
|
17
|
+
- Tiny improvements to french translation [\#1273](https://github.com/bensheldon/good_job/pull/1273) ([francois-ferrandis](https://github.com/francois-ferrandis))
|
18
|
+
- Load metrics for top nav asynchronously [\#1231](https://github.com/bensheldon/good_job/pull/1231) ([binarygit](https://github.com/binarygit))
|
19
|
+
|
3
20
|
## [v3.26.1](https://github.com/bensheldon/good_job/tree/v3.26.1) (2024-03-01)
|
4
21
|
|
5
22
|
[Full Changelog](https://github.com/bensheldon/good_job/compare/v3.26.0...v3.26.1)
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module GoodJob
|
4
|
+
class MetricsController < ApplicationController
|
5
|
+
def primary_nav
|
6
|
+
jobs_count = GoodJob::Job.count
|
7
|
+
batches_count = GoodJob::BatchRecord.migrated? ? GoodJob::BatchRecord.all.size : 0
|
8
|
+
cron_entries_count = GoodJob::CronEntry.all.size
|
9
|
+
processes_count = GoodJob::Process.active.count
|
10
|
+
|
11
|
+
render json: {
|
12
|
+
jobs_count: number_to_human(jobs_count),
|
13
|
+
batches_count: number_to_human(batches_count),
|
14
|
+
cron_entries_count: number_to_human(cron_entries_count),
|
15
|
+
processes_count: number_to_human(processes_count),
|
16
|
+
}
|
17
|
+
end
|
18
|
+
|
19
|
+
private
|
20
|
+
|
21
|
+
def number_to_human(count)
|
22
|
+
helpers.number_to_human(count, **helpers.translate_hash("good_job.number.human.decimal_units"))
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -9,8 +9,10 @@ import LivePoll from "live_poll";
|
|
9
9
|
|
10
10
|
import { Application } from "stimulus";
|
11
11
|
import ThemeController from "theme_controller";
|
12
|
+
import AsyncValuesController from "async_values_controller";
|
12
13
|
window.Stimulus = Application.start();
|
13
14
|
Stimulus.register("theme", ThemeController)
|
15
|
+
Stimulus.register("async-values", AsyncValuesController)
|
14
16
|
|
15
17
|
documentReady(function() {
|
16
18
|
renderCharts();
|
@@ -0,0 +1,31 @@
|
|
1
|
+
import {Controller} from "stimulus"
|
2
|
+
|
3
|
+
// Fetches JSON values from the server and updates the targets with the response.
|
4
|
+
export default class extends Controller {
|
5
|
+
static values = {
|
6
|
+
url: String,
|
7
|
+
}
|
8
|
+
static targets = ["value"]
|
9
|
+
|
10
|
+
connect() {
|
11
|
+
this.#fetch();
|
12
|
+
}
|
13
|
+
|
14
|
+
async #fetch() {
|
15
|
+
const data = await fetch(this.urlValue).then(response => response.json())
|
16
|
+
this.valueTargets.forEach((target) => {
|
17
|
+
target.textContent = data[target.dataset['asyncValuesKey']];
|
18
|
+
target.classList.remove('d-none');
|
19
|
+
|
20
|
+
// When `data-async-values-zero-class="css-class"` is set, add `css-class` to the target if the value is "0"
|
21
|
+
if (target.dataset['asyncValuesZeroClass']) {
|
22
|
+
const className = target.dataset['asyncValuesZeroClass'];
|
23
|
+
if (data[target.dataset['asyncValuesKey']] === "0") {
|
24
|
+
target.classList.add(className);
|
25
|
+
} else {
|
26
|
+
target.classList.remove(className);
|
27
|
+
}
|
28
|
+
}
|
29
|
+
});
|
30
|
+
}
|
31
|
+
}
|
@@ -14,33 +14,29 @@
|
|
14
14
|
</button>
|
15
15
|
|
16
16
|
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
17
|
-
<ul class="navbar-nav me-auto">
|
17
|
+
<ul class="navbar-nav me-auto" data-controller="async-values" data-async-values-url-value="<%= metrics_primary_nav_path %>">
|
18
18
|
<li class="nav-item">
|
19
19
|
<%= link_to jobs_path, class: ["nav-link", ("active" if controller_name == 'jobs')] do %>
|
20
20
|
<%= t(".jobs") %>
|
21
|
-
|
22
|
-
<span class="badge bg-secondary rounded-pill"><%= number_to_human(jobs_count, **translate_hash("good_job.number.human.decimal_units")) %></span>
|
21
|
+
<span data-async-values-target="value" data-async-values-key="jobs_count" class="badge bg-secondary rounded-pill d-none"></span>
|
23
22
|
<% end %>
|
24
23
|
</li>
|
25
24
|
<li class="nav-item">
|
26
25
|
<%= link_to batches_path, class: ["nav-link", ("active" if controller_name == 'batches')] do %>
|
27
26
|
<%=t ".batches" %>
|
28
|
-
|
29
|
-
<span class="badge bg-secondary rounded-pill"><%= number_to_human(batches_count, **translate_hash("good_job.number.human.decimal_units")) %></span>
|
27
|
+
<span data-async-values-target="value" data-async-values-key="batches_count" class="badge bg-secondary rounded-pill d-none"></span>
|
30
28
|
<% end %>
|
31
29
|
</li>
|
32
30
|
<li class="nav-item">
|
33
31
|
<%= link_to cron_entries_path, class: ["nav-link", ("active" if controller_name == 'cron_entries')] do %>
|
34
32
|
<%= t(".cron_schedules") %>
|
35
|
-
|
36
|
-
<span class="badge bg-secondary rounded-pill"><%= cron_entries_count %></span>
|
33
|
+
<span data-async-values-target="value" data-async-values-key="cron_entries_count" class="badge bg-secondary rounded-pill d-none"></span>
|
37
34
|
<% end %>
|
38
35
|
</li>
|
39
36
|
<li class="nav-item">
|
40
37
|
<%= link_to processes_path, class: ["nav-link", ("active" if controller_name == 'processes')] do %>
|
41
38
|
<%= t(".processes") %>
|
42
|
-
|
43
|
-
<span class="badge bg-secondary rounded-pill <%= "bg-danger" if processes_count == 0 %>"><%= processes_count %></span>
|
39
|
+
<span data-async-values-target="value" data-async-values-key="processes_count" data-async-values-zero-class="bg-danger" class="badge bg-secondary rounded-pill d-none"></span>
|
44
40
|
<% end %>
|
45
41
|
</li>
|
46
42
|
</ul>
|
data/config/locales/fr.yml
CHANGED
@@ -214,11 +214,11 @@ fr:
|
|
214
214
|
all: Tous
|
215
215
|
all_jobs: Tous les jobs
|
216
216
|
all_queues: Toutes les files d'attente
|
217
|
-
clear:
|
217
|
+
clear: Réinitialiser
|
218
218
|
job_name: Nom du job
|
219
219
|
placeholder: Recherche par classe, ID de job, paramètres de job et texte d'erreur.
|
220
220
|
queue_name: Nom de la file d'attente
|
221
|
-
search:
|
221
|
+
search: Rechercher
|
222
222
|
navbar:
|
223
223
|
batches: Lots
|
224
224
|
cron_schedules: Cron
|
@@ -232,12 +232,12 @@ fr:
|
|
232
232
|
light: Lumière
|
233
233
|
theme: Thème
|
234
234
|
secondary_navbar:
|
235
|
-
inspiration: N'oublie pas, toi aussi tu fais du bon boulot
|
235
|
+
inspiration: N'oublie pas, toi aussi tu fais du bon boulot !
|
236
236
|
last_updated: Dernière mise à jour
|
237
237
|
status:
|
238
238
|
discarded: Mis au rebut
|
239
239
|
queued: À la file
|
240
240
|
retried: Réessayés
|
241
241
|
running: En cours
|
242
|
-
scheduled:
|
242
|
+
scheduled: Planifiés
|
243
243
|
succeeded: Réussis
|
data/config/routes.rb
CHANGED
data/lib/good_job/version.rb
CHANGED
data/lib/good_job.rb
CHANGED
@@ -3,44 +3,44 @@
|
|
3
3
|
require "active_job"
|
4
4
|
require "active_job/queue_adapters"
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
6
|
+
require_relative "good_job/version"
|
7
|
+
require_relative "good_job/engine"
|
8
|
+
|
9
|
+
require_relative "good_job/adapter"
|
10
|
+
require_relative "active_job/queue_adapters/good_job_adapter"
|
11
|
+
require_relative "good_job/active_job_extensions/batches"
|
12
|
+
require_relative "good_job/active_job_extensions/concurrency"
|
13
|
+
require_relative "good_job/interrupt_error"
|
14
|
+
require_relative "good_job/active_job_extensions/interrupt_errors"
|
15
|
+
require_relative "good_job/active_job_extensions/labels"
|
16
|
+
require_relative "good_job/active_job_extensions/notify_options"
|
17
|
+
|
18
|
+
require_relative "good_job/overridable_connection"
|
19
|
+
require_relative "good_job/bulk"
|
20
|
+
require_relative "good_job/callable"
|
21
|
+
require_relative "good_job/capsule"
|
22
|
+
require_relative "good_job/cleanup_tracker"
|
23
|
+
require_relative "good_job/cli"
|
24
|
+
require_relative "good_job/configuration"
|
25
|
+
require_relative "good_job/cron_manager"
|
26
|
+
require_relative "good_job/current_thread"
|
27
|
+
require_relative "good_job/daemon"
|
28
|
+
require_relative "good_job/dependencies"
|
29
|
+
require_relative "good_job/job_performer"
|
30
|
+
require_relative "good_job/job_performer/metrics"
|
31
|
+
require_relative "good_job/log_subscriber"
|
32
|
+
require_relative "good_job/multi_scheduler"
|
33
|
+
require_relative "good_job/notifier"
|
34
|
+
require_relative "good_job/poller"
|
35
|
+
require_relative "good_job/probe_server"
|
36
|
+
require_relative "good_job/probe_server/healthcheck_middleware"
|
37
|
+
require_relative "good_job/probe_server/not_found_app"
|
38
|
+
require_relative "good_job/probe_server/simple_handler"
|
39
|
+
require_relative "good_job/probe_server/webrick_handler"
|
40
|
+
require_relative "good_job/scheduler"
|
41
|
+
require_relative "good_job/shared_executor"
|
42
|
+
require_relative "good_job/systemd_service"
|
43
|
+
require_relative "good_job/thread_status"
|
44
44
|
|
45
45
|
# GoodJob is a multithreaded, Postgres-based, ActiveJob backend for Ruby on Rails.
|
46
46
|
#
|
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.26.
|
4
|
+
version: 3.26.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: 2024-03-
|
11
|
+
date: 2024-03-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activejob
|
@@ -168,16 +168,16 @@ dependencies:
|
|
168
168
|
name: puma
|
169
169
|
requirement: !ruby/object:Gem::Requirement
|
170
170
|
requirements:
|
171
|
-
- - "
|
171
|
+
- - ">="
|
172
172
|
- !ruby/object:Gem::Version
|
173
|
-
version: '
|
173
|
+
version: '0'
|
174
174
|
type: :development
|
175
175
|
prerelease: false
|
176
176
|
version_requirements: !ruby/object:Gem::Requirement
|
177
177
|
requirements:
|
178
|
-
- - "
|
178
|
+
- - ">="
|
179
179
|
- !ruby/object:Gem::Version
|
180
|
-
version: '
|
180
|
+
version: '0'
|
181
181
|
- !ruby/object:Gem::Dependency
|
182
182
|
name: rspec-rails
|
183
183
|
requirement: !ruby/object:Gem::Requirement
|
@@ -268,11 +268,13 @@ files:
|
|
268
268
|
- app/controllers/good_job/cron_entries_controller.rb
|
269
269
|
- app/controllers/good_job/frontends_controller.rb
|
270
270
|
- app/controllers/good_job/jobs_controller.rb
|
271
|
+
- app/controllers/good_job/metrics_controller.rb
|
271
272
|
- app/controllers/good_job/processes_controller.rb
|
272
273
|
- app/filters/good_job/base_filter.rb
|
273
274
|
- app/filters/good_job/batches_filter.rb
|
274
275
|
- app/filters/good_job/jobs_filter.rb
|
275
276
|
- app/frontend/good_job/application.js
|
277
|
+
- app/frontend/good_job/modules/async_values_controller.js
|
276
278
|
- app/frontend/good_job/modules/charts.js
|
277
279
|
- app/frontend/good_job/modules/checkbox_toggle.js
|
278
280
|
- app/frontend/good_job/modules/document_ready.js
|