good_job 4.8.1 → 4.8.2
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 +13 -1
- data/app/models/concerns/good_job/filterable.rb +3 -3
- data/app/models/good_job/job.rb +10 -13
- data/app/views/good_job/jobs/show.html.erb +1 -1
- data/lib/good_job/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: dad9150afd9c10b0e0bd9850f5252000456a22f6e7cd9ccfd399ccf5f8e797aa
|
|
4
|
+
data.tar.gz: a2d3897d12bbd2b4b5860e4306038f71bc0c5f63ed3d03f97b0e06bfc21cfa5b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2375178420c7a749563bb93c4be342dd594dd170095297e38d71dae31f657be30d75a3220e2e072e731ae91aad7cb51f3ad550e89a7c210da1464ef148e3552f
|
|
7
|
+
data.tar.gz: 51956eb4fcc4c12a0a4aa832720be3cf1c462f0c55cab637a550ff104a55c7f28edad7e079772b324667bc67bc0003ffe69d12c0446ea289f369ef506a4e6286
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [v4.8.2](https://github.com/bensheldon/good_job/tree/v4.8.2) (2025-01-26)
|
|
4
|
+
|
|
5
|
+
[Full Changelog](https://github.com/bensheldon/good_job/compare/v4.8.1...v4.8.2)
|
|
6
|
+
|
|
7
|
+
**Fixed bugs:**
|
|
8
|
+
|
|
9
|
+
- Ensure that executions are properly ordered in the dashboard [\#1588](https://github.com/bensheldon/good_job/pull/1588) ([Earlopain](https://github.com/Earlopain))
|
|
10
|
+
|
|
11
|
+
**Merged pull requests:**
|
|
12
|
+
|
|
13
|
+
- Fix passing a block to `advisory_lock` in tests [\#1587](https://github.com/bensheldon/good_job/pull/1587) ([Earlopain](https://github.com/Earlopain))
|
|
14
|
+
- Expect `Job#scheduled_at` to always be present; remove nil checks [\#1585](https://github.com/bensheldon/good_job/pull/1585) ([bensheldon](https://github.com/bensheldon))
|
|
15
|
+
|
|
3
16
|
## [v4.8.1](https://github.com/bensheldon/good_job/tree/v4.8.1) (2025-01-24)
|
|
4
17
|
|
|
5
18
|
[Full Changelog](https://github.com/bensheldon/good_job/compare/v4.8.0...v4.8.1)
|
|
@@ -11,7 +24,6 @@
|
|
|
11
24
|
**Closed issues:**
|
|
12
25
|
|
|
13
26
|
- Losing "Processes" on the dashboard [\#1582](https://github.com/bensheldon/good_job/issues/1582)
|
|
14
|
-
- Notifier errored: TypeError: ActiveSupport::TimeWithZone can't be coerced into Integer [\#1581](https://github.com/bensheldon/good_job/issues/1581)
|
|
15
27
|
- Ability to pause queues [\#1574](https://github.com/bensheldon/good_job/issues/1574)
|
|
16
28
|
|
|
17
29
|
## [v4.8.0](https://github.com/bensheldon/good_job/tree/v4.8.0) (2025-01-22)
|
|
@@ -15,11 +15,11 @@ module GoodJob
|
|
|
15
15
|
# Display records after this ID for keyset pagination
|
|
16
16
|
# @return [ActiveRecord::Relation]
|
|
17
17
|
scope :display_all, (lambda do |after_scheduled_at: nil, after_id: nil|
|
|
18
|
-
query = order(Arel.sql('
|
|
18
|
+
query = order(Arel.sql('scheduled_at DESC, id DESC'))
|
|
19
19
|
if after_scheduled_at.present? && after_id.present?
|
|
20
|
-
query = query.where Arel::Nodes::Grouping.new([
|
|
20
|
+
query = query.where Arel::Nodes::Grouping.new([arel_table["scheduled_at"], arel_table["id"]]).lt(Arel::Nodes::Grouping.new([bind_value('scheduled_at', after_scheduled_at, ActiveRecord::Type::DateTime), bind_value('id', after_id, ActiveRecord::ConnectionAdapters::PostgreSQL::OID::Uuid)]))
|
|
21
21
|
elsif after_scheduled_at.present?
|
|
22
|
-
query = query.where
|
|
22
|
+
query = query.where arel_table["scheduled_at"].lt(bind_value('scheduled_at', after_scheduled_at, ActiveRecord::Type::DateTime))
|
|
23
23
|
end
|
|
24
24
|
query
|
|
25
25
|
end)
|
data/app/models/good_job/job.rb
CHANGED
|
@@ -54,11 +54,11 @@ module GoodJob
|
|
|
54
54
|
scope :finished_before, ->(timestamp) { where(arel_table['finished_at'].lteq(bind_value('finished_at', timestamp, ActiveRecord::Type::DateTime))) }
|
|
55
55
|
|
|
56
56
|
# First execution will run in the future
|
|
57
|
-
scope :scheduled, -> { where(finished_at: nil).where(
|
|
57
|
+
scope :scheduled, -> { where(finished_at: nil).where(arel_table['scheduled_at'].gt(bind_value('scheduled_at', Time.current, ActiveRecord::Type::DateTime))).where(params_execution_count.lt(2)) }
|
|
58
58
|
# Execution errored, will run in the future
|
|
59
|
-
scope :retried, -> { where(finished_at: nil).where(
|
|
59
|
+
scope :retried, -> { where(finished_at: nil).where(arel_table['scheduled_at'].gt(bind_value('scheduled_at', Time.current, ActiveRecord::Type::DateTime))).where(params_execution_count.gt(1)) }
|
|
60
60
|
# Immediate/Scheduled time to run has passed, waiting for an available thread run
|
|
61
|
-
scope :queued, -> { where(performed_at: nil, finished_at: nil).where(
|
|
61
|
+
scope :queued, -> { where(performed_at: nil, finished_at: nil).where(arel_table['scheduled_at'].lteq(bind_value('scheduled_at', Time.current, ActiveRecord::Type::DateTime))) }
|
|
62
62
|
# Advisory locked and executing
|
|
63
63
|
scope :running, -> { where.not(performed_at: nil).where(finished_at: nil) }
|
|
64
64
|
# Finished executing (succeeded or discarded)
|
|
@@ -94,7 +94,7 @@ module GoodJob
|
|
|
94
94
|
# @!method only_scheduled
|
|
95
95
|
# @!scope class
|
|
96
96
|
# @return [ActiveRecord::Relation]
|
|
97
|
-
scope :only_scheduled, -> { where(arel_table['scheduled_at'].lteq(bind_value('scheduled_at', DateTime.current, ActiveRecord::Type::DateTime)))
|
|
97
|
+
scope :only_scheduled, -> { where(arel_table['scheduled_at'].lteq(bind_value('scheduled_at', DateTime.current, ActiveRecord::Type::DateTime))) }
|
|
98
98
|
|
|
99
99
|
# Exclude jobs that are paused via queue_name or job_class.
|
|
100
100
|
# Only applies when enable_pauses configuration is true.
|
|
@@ -166,7 +166,7 @@ module GoodJob
|
|
|
166
166
|
# @!method schedule_ordered
|
|
167
167
|
# @!scope class
|
|
168
168
|
# @return [ActiveRecord::Relation]
|
|
169
|
-
scope :schedule_ordered, -> { order(
|
|
169
|
+
scope :schedule_ordered, -> { order(scheduled_at: :asc) }
|
|
170
170
|
|
|
171
171
|
# Get Jobs on queues that match the given queue string.
|
|
172
172
|
# @!method queue_string(string)
|
|
@@ -249,10 +249,6 @@ module GoodJob
|
|
|
249
249
|
Arel.sql('integer')
|
|
250
250
|
)
|
|
251
251
|
end
|
|
252
|
-
|
|
253
|
-
def coalesce_scheduled_at_created_at
|
|
254
|
-
arel_table.coalesce(arel_table['scheduled_at'], arel_table['created_at'])
|
|
255
|
-
end
|
|
256
252
|
end
|
|
257
253
|
|
|
258
254
|
def self.build_for_enqueue(active_job, scheduled_at: nil)
|
|
@@ -344,12 +340,13 @@ module GoodJob
|
|
|
344
340
|
|
|
345
341
|
after ||= Time.current
|
|
346
342
|
after_bind = bind_value('scheduled_at', after, ActiveRecord::Type::DateTime)
|
|
347
|
-
after_query = query.where(arel_table['scheduled_at'].gt(after_bind))
|
|
348
|
-
after_at = after_query.limit(limit).pluck(:scheduled_at
|
|
343
|
+
after_query = query.where(arel_table['scheduled_at'].gt(after_bind))
|
|
344
|
+
after_at = after_query.limit(limit).pluck(:scheduled_at)
|
|
349
345
|
|
|
350
346
|
if now_limit&.positive?
|
|
351
|
-
|
|
352
|
-
|
|
347
|
+
now_bind = bind_value('scheduled_at', Time.current, ActiveRecord::Type::DateTime)
|
|
348
|
+
now_query = query.where(arel_table['scheduled_at'].lt(now_bind))
|
|
349
|
+
now_at = now_query.limit(now_limit).pluck(:scheduled_at)
|
|
353
350
|
end
|
|
354
351
|
|
|
355
352
|
Array(now_at) + after_at
|
data/lib/good_job/version.rb
CHANGED
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.8.
|
|
4
|
+
version: 4.8.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ben Sheldon
|
|
8
8
|
bindir: exe
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date: 2025-01-
|
|
10
|
+
date: 2025-01-26 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: activejob
|