good_job 4.24.0 → 4.24.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ca3ea73eb3548ddaa1b84dab18b341c9c8182f91d52b82a41681cfa2080550da
4
- data.tar.gz: 9fc5590d811d1b04c847054d685d9f911910356c33d0726d1ba1620a2228caf5
3
+ metadata.gz: 6973f64ae5640b5157d72d26438c7bb155072f07a98829461324b548f0092a19
4
+ data.tar.gz: 5b9dbd764aa128a9b54797e1f0abe0912942a391d656070ca86f4302041fed33
5
5
  SHA512:
6
- metadata.gz: 2bca41349e888ed1e16ad8a3da30cfb17390eb1451803aa14b2bed95c39494a6cf83b7eb29a6cb39d86b1545756d58ced8c3cbf4acd5d53d56873d2652ce5766
7
- data.tar.gz: f10b1e0bd0f51edce6879785642730d96367fe2f4fdd5d4206576c510993950fb278db1e38d3ed6c3a2bd1a9050aa99502a4e81a2e8dd3f2a78806c5c509b0a0
6
+ metadata.gz: e9a5a767e63afdf414c61d9437486d2670d14bc37f006963a5f4c2f13a6b23805fb9fb70e51068d67ee6f7f3133463ba201798a0464260fc0cba09fa319cbeb3
7
+ data.tar.gz: 49c3e706bc73a2715993d38a0713ec736864c7fe9a434461db87092b0ba20c0900043e324887d17c5d40e14d0dd3df0c304caae0c77f912e952a8b66c65beff8
data/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # Changelog
2
2
 
3
+ ## [v4.24.1](https://github.com/bensheldon/good_job/tree/v4.24.1) (2026-11-03)
4
+
5
+ [Full Changelog](https://github.com/bensheldon/good_job/compare/v4.24.0...v4.24.1)
6
+
7
+ **Fixed bugs:**
8
+
9
+ - Look up cron settings once, not per entry, in the primary nav \(36 ms → 0.75 ms at 100 entries\) [\#1906](https://github.com/bensheldon/good_job/pull/1906) ([czj](https://github.com/czj))
10
+ - Sort dashboard chart legends alphabetically [\#1903](https://github.com/bensheldon/good_job/pull/1903) ([6temes](https://github.com/6temes))
11
+
12
+ **Closed issues:**
13
+
14
+ - Unique constraint violation messages in postgres error logs [\#1536](https://github.com/bensheldon/good_job/issues/1536)
15
+
16
+ **Merged pull requests:**
17
+
18
+ - Document expected duplicate key errors from cron in Postgres logs [\#1908](https://github.com/bensheldon/good_job/pull/1908) ([rafayqayyum](https://github.com/rafayqayyum))
19
+ - Bump github/codeql-action from 4.38.2 to 4.39.1 [\#1907](https://github.com/bensheldon/good_job/pull/1907) ([dependabot[bot]](https://github.com/apps/dependabot))
20
+
3
21
  ## [v4.24.0](https://github.com/bensheldon/good_job/tree/v4.24.0) (2026-10-29)
4
22
 
5
23
  [Full Changelog](https://github.com/bensheldon/good_job/compare/v4.23.1...v4.24.0)
data/README.md CHANGED
@@ -805,6 +805,8 @@ GoodJob can enqueue Active Job jobs on a recurring basis that can be used as a r
805
805
 
806
806
  Cron-style jobs can be enequeued by any GoodJob process (e.g., CLI or `:async` execution mode) that has `config.good_job.enable_cron` set to `true`. Enabling cron on multiple processes will not enqueue duplicate jobs; GoodJob's cron uses unique indexes to ensure that only a single job is enqueued for a given time interval. In order for this to work, GoodJob must preserve cron-created job records; these records will be automatically deleted like any other preserved record.
807
807
 
808
+ When cron is enabled on multiple processes, each process attempts to enqueue every scheduled job and all but one of the inserts fail on the unique index. GoodJob rescues these failures, but PostgreSQL still writes them to its own log as `duplicate key value violates unique constraint "index_good_jobs_on_cron_key_and_cron_at_cond"`. These errors are expected and harmless. If they are too noisy, enable cron on a single process instead, at the cost of no redundancy if that process stops.
809
+
808
810
  Cron-format is parsed by the [`fugit`](https://github.com/floraison/fugit) gem, which has support for seconds-level resolution (e.g. `* * * * * *`) and natural language parsing (e.g. `every second`).
809
811
 
810
812
  If you use the [Dashboard](#dashboard) the scheduled tasks can be viewed in the 'cron' menu. In this view you can also disable a task or run/enqueue a task immediately.
@@ -49,7 +49,7 @@ module GoodJob
49
49
 
50
50
  executions_data = GoodJob::Job.connection_pool.with_connection { |conn| conn.exec_query(GoodJob::Job.pg_or_jdbc_query(sum_query), "GoodJob Performance Chart", binds) }
51
51
 
52
- job_names = executions_data.reject { |d| d['value'].nil? }.map { |d| d['job_class'] || BaseFilter::EMPTY }.uniq
52
+ job_names = executions_data.reject { |d| d['value'].nil? }.map { |d| d['job_class'] || BaseFilter::EMPTY }.uniq.sort
53
53
  timestamp_values = []
54
54
  timestamps = []
55
55
  jobs_data = executions_data.to_a.group_by { |d| d['timestamp'] }.each_with_object({}) do |(timestamp, values), hash|
@@ -48,7 +48,7 @@ module GoodJob
48
48
 
49
49
  executions_data = GoodJob::Job.connection_pool.with_connection { |conn| conn.exec_query(GoodJob::Job.pg_or_jdbc_query(count_query), "GoodJob Dashboard Chart", binds) }
50
50
 
51
- queue_names = executions_data.reject { |d| d['count'].nil? }.map { |d| d['queue_name'] || BaseFilter::EMPTY }.uniq
51
+ queue_names = executions_data.reject { |d| d['count'].nil? }.map { |d| d['queue_name'] || BaseFilter::EMPTY }.uniq.sort
52
52
  labels = []
53
53
  queues_data = executions_data.to_a.group_by { |d| d['timestamp'] }.each_with_object({}) do |(timestamp, values), hash|
54
54
  labels << timestamp.in_time_zone.strftime('%H:%M')
@@ -8,7 +8,9 @@ module GoodJob
8
8
  batches_count = GoodJob::BatchRecord.all.size
9
9
  cron_entries = GoodJob::CronEntry.all
10
10
  cron_entries_count = cron_entries.size
11
- cron_entries_enabled_count = cron_entries.count(&:enabled?)
11
+ cron_entries_enabled_count = GoodJob::Setting.cron_keys_enabled(
12
+ cron_entries.map { |entry| [entry.key, entry.enabled_by_default?] }
13
+ ).values.count(true)
12
14
  cron_entries_paused_count = cron_entries_count - cron_entries_enabled_count
13
15
  pauses_count = GoodJob::Setting.paused.values.sum(&:count)
14
16
  processes_count = GoodJob::Process.active.count
@@ -3,7 +3,7 @@
3
3
 
4
4
  module GoodJob
5
5
  # GoodJob gem version.
6
- VERSION = '4.24.0'
6
+ VERSION = '4.24.1'
7
7
 
8
8
  # GoodJob version as Gem::Version object
9
9
  GEM_VERSION = Gem::Version.new(VERSION)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: good_job
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.24.0
4
+ version: 4.24.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Sheldon