good_job 4.9.3 → 4.10.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 +23 -0
- data/app/filters/good_job/jobs_filter.rb +16 -1
- data/app/models/good_job/batch_record.rb +13 -1
- data/app/models/good_job/job.rb +7 -0
- data/app/views/good_job/batches/_table.erb +1 -1
- data/lib/good_job/configuration.rb +1 -0
- data/lib/good_job/version.rb +1 -1
- data/lib/good_job.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 464fe8415569d7b3a2e09f1ae95052ae8349969cb9086ee56e85d7d02a161de8
|
4
|
+
data.tar.gz: 9c1dd45dc3e99d9ed218a7123a38ab6f106ebf8b93871af86655d5ee9cf3a64f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2270c9d1fdd9c0b953f921ac873ffed572270907ce1d99cbb92b1ddb63b9afa979603af20aacbd2b01745b4e76743966d5851ab1a742f60fcb29258aaef5cae9
|
7
|
+
data.tar.gz: 62802abd14cd93633bc7667bf42b74cbeb7bb420de6a85f3dd0fa7e93aad63eb0714f52976d80b527152bd6e7746a231a17fd46a15f8674ec7e90149df410b05
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,28 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## [v4.10.0](https://github.com/bensheldon/good_job/tree/v4.10.0) (2025-04-26)
|
4
|
+
|
5
|
+
[Full Changelog](https://github.com/bensheldon/good_job/compare/v4.9.3...v4.10.0)
|
6
|
+
|
7
|
+
**Implemented enhancements:**
|
8
|
+
|
9
|
+
- Improve dashboard performance when searching for job ID [\#1619](https://github.com/bensheldon/good_job/pull/1619) ([francois](https://github.com/francois))
|
10
|
+
|
11
|
+
**Fixed bugs:**
|
12
|
+
|
13
|
+
- Fix Batches dashboard deserealization error [\#1628](https://github.com/bensheldon/good_job/pull/1628) ([JulianPasquale](https://github.com/JulianPasquale))
|
14
|
+
- Fix enqueue\_after\_transaction\_commit config [\#1626](https://github.com/bensheldon/good_job/pull/1626) ([santib](https://github.com/santib))
|
15
|
+
|
16
|
+
**Closed issues:**
|
17
|
+
|
18
|
+
- Retried jobs with GoodJob::ActiveJobExtensions::Concurrency::ConcurrencyExceededError lose their arguments [\#1620](https://github.com/bensheldon/good_job/issues/1620)
|
19
|
+
- Searching for job ID fails on Heroku due to 30s request limit [\#1618](https://github.com/bensheldon/good_job/issues/1618)
|
20
|
+
- Poor performance when enqueuing many throttled jobs because of unindexed queries [\#1603](https://github.com/bensheldon/good_job/issues/1603)
|
21
|
+
|
22
|
+
**Merged pull requests:**
|
23
|
+
|
24
|
+
- Update `GoodJob.migrated?` for latest migration [\#1631](https://github.com/bensheldon/good_job/pull/1631) ([Earlopain](https://github.com/Earlopain))
|
25
|
+
|
3
26
|
## [v4.9.3](https://github.com/bensheldon/good_job/tree/v4.9.3) (2025-03-10)
|
4
27
|
|
5
28
|
[Full Changelog](https://github.com/bensheldon/good_job/compare/v4.9.2...v4.9.3)
|
@@ -2,6 +2,8 @@
|
|
2
2
|
|
3
3
|
module GoodJob
|
4
4
|
class JobsFilter < BaseFilter
|
5
|
+
UUID_REGEX = /\A[0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}\z/i
|
6
|
+
|
5
7
|
def state_names
|
6
8
|
%w[scheduled retried queued running succeeded discarded]
|
7
9
|
end
|
@@ -25,7 +27,16 @@ module GoodJob
|
|
25
27
|
|
26
28
|
query = query.job_class(filter_params[:job_class]) if filter_params[:job_class].present?
|
27
29
|
query = query.where(queue_name: filter_params[:queue_name]) if filter_params[:queue_name].present?
|
28
|
-
|
30
|
+
|
31
|
+
search_query = filter_params[:query]&.strip
|
32
|
+
if search_query.present?
|
33
|
+
query = if query_is_uuid_and_job_exists?(search_query)
|
34
|
+
query.where(active_job_id: search_query)
|
35
|
+
else
|
36
|
+
query.search_text(search_query)
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
29
40
|
query = query.where(cron_key: filter_params[:cron_key]) if filter_params[:cron_key].present?
|
30
41
|
query = query.where(finished_at: finished_since(filter_params[:finished_since])..) if filter_params[:finished_since].present?
|
31
42
|
|
@@ -90,5 +101,9 @@ module GoodJob
|
|
90
101
|
7.days.ago
|
91
102
|
end
|
92
103
|
end
|
104
|
+
|
105
|
+
def query_is_uuid_and_job_exists?(search_query)
|
106
|
+
@_query_is_uuid_and_job_exists ||= search_query&.match?(UUID_REGEX) && base_query.exists?(active_job_id: search_query)
|
107
|
+
end
|
93
108
|
end
|
94
109
|
end
|
@@ -40,7 +40,19 @@ module GoodJob
|
|
40
40
|
end
|
41
41
|
|
42
42
|
def display_attributes
|
43
|
-
|
43
|
+
display_properties = begin
|
44
|
+
serialized_properties
|
45
|
+
rescue ActiveJob::DeserializationError
|
46
|
+
JSON.parse(read_attribute_before_type_cast(:serialized_properties))
|
47
|
+
end
|
48
|
+
|
49
|
+
attribute_names.to_h do |name|
|
50
|
+
if name == "serialized_properties"
|
51
|
+
["properties", display_properties]
|
52
|
+
else
|
53
|
+
[name, self[name]]
|
54
|
+
end
|
55
|
+
end
|
44
56
|
end
|
45
57
|
|
46
58
|
def _continue_discard_or_finish(job = nil, lock: true)
|
data/app/models/good_job/job.rb
CHANGED
@@ -249,6 +249,13 @@ module GoodJob
|
|
249
249
|
Arel.sql('integer')
|
250
250
|
)
|
251
251
|
end
|
252
|
+
|
253
|
+
def concurrency_key_created_at_index_migrated?
|
254
|
+
return true if connection.index_name_exists?(:good_jobs, :index_good_jobs_on_concurrency_key_and_created_at)
|
255
|
+
|
256
|
+
migration_pending_warning!
|
257
|
+
false
|
258
|
+
end
|
252
259
|
end
|
253
260
|
|
254
261
|
def self.build_for_enqueue(active_job, scheduled_at: nil)
|
@@ -76,7 +76,7 @@
|
|
76
76
|
</div>
|
77
77
|
</div>
|
78
78
|
<%= tag.div id: dom_id(batch, "properties"), class: "batch-properties list-group-item collapse small bg-dark text-light" do %>
|
79
|
-
<%= tag.pre JSON.pretty_generate(batch.properties) %>
|
79
|
+
<%= tag.pre JSON.pretty_generate(batch.display_attributes["properties"]) %>
|
80
80
|
<% end %>
|
81
81
|
<% end %>
|
82
82
|
<% else %>
|
@@ -367,6 +367,7 @@ module GoodJob
|
|
367
367
|
# @return [Boolean]
|
368
368
|
def enqueue_after_transaction_commit
|
369
369
|
return options[:enqueue_after_transaction_commit] unless options[:enqueue_after_transaction_commit].nil?
|
370
|
+
return rails_config[:enqueue_after_transaction_commit] unless rails_config[:enqueue_after_transaction_commit].nil?
|
370
371
|
|
371
372
|
DEFAULT_ENQUEUE_AFTER_TRANSACTION_COMMIT
|
372
373
|
end
|
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::
|
293
|
+
GoodJob::Job.concurrency_key_created_at_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.10.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
|
@@ -421,7 +421,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
421
421
|
- !ruby/object:Gem::Version
|
422
422
|
version: '0'
|
423
423
|
requirements: []
|
424
|
-
rubygems_version: 3.6.
|
424
|
+
rubygems_version: 3.6.8
|
425
425
|
specification_version: 4
|
426
426
|
summary: A multithreaded, Postgres-based ActiveJob backend for Ruby on Rails
|
427
427
|
test_files: []
|