acidic_job 1.0.0.pre24 → 1.0.0.pre25
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/acidic_job/awaiting.rb +1 -0
- data/lib/acidic_job/run.rb +3 -1
- data/lib/acidic_job/version.rb +1 -1
- data/lib/acidic_job.rb +5 -0
- 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: 305652928d6e3948110121767a94388b2f569a0ccc4693944cde5df2938c9a4b
|
4
|
+
data.tar.gz: 1c612e9380eaa0f73dd194441f69a988015e304c55c047793ad292f8c46e6c19
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f720cc6bebf8bdc4197295a3501b750e4b8b7741d7f04d6096aba426d45b37027d650664b038f1e45a32dc0763af9cd88ccec41c6d32dbdde56d0937a5af4df2
|
7
|
+
data.tar.gz: a7639fe45ebbea79331a8355a5f8a20fc95182341d575ca8a8040a0733cfe242f5e694ec98d1b442eea5235ccabf4280bd91f20f28ff1814b0bd32ffa95a8bff
|
data/Gemfile.lock
CHANGED
data/lib/acidic_job/awaiting.rb
CHANGED
data/lib/acidic_job/run.rb
CHANGED
@@ -31,7 +31,9 @@ module AcidicJob
|
|
31
31
|
scope :staged, -> { where(staged: true) }
|
32
32
|
scope :unstaged, -> { where(staged: false) }
|
33
33
|
scope :finished, -> { where(recovery_point: FINISHED_RECOVERY_POINT) }
|
34
|
-
scope :
|
34
|
+
scope :outstanding, lambda {
|
35
|
+
where.not(recovery_point: FINISHED_RECOVERY_POINT).or(where(recovery_point: [nil, ""]))
|
36
|
+
}
|
35
37
|
|
36
38
|
with_options unless: :staged? do
|
37
39
|
validates :last_run_at, presence: true
|
data/lib/acidic_job/version.rb
CHANGED
data/lib/acidic_job.rb
CHANGED
@@ -50,6 +50,7 @@ module AcidicJob
|
|
50
50
|
# TODO: write test for a staged job that uses awaits
|
51
51
|
klass.set_callback :perform, :after, :reenqueue_awaited_by_job,
|
52
52
|
if: -> { was_awaited_job? && !was_workflow_job? }
|
53
|
+
klass.set_callback :perform, :after, :finish_staged_job, if: -> { was_staged_job? && !was_workflow_job? }
|
53
54
|
klass.define_callbacks :finish
|
54
55
|
klass.set_callback :finish, :after, :reenqueue_awaited_by_job,
|
55
56
|
if: -> { was_workflow_job? && was_awaited_job? }
|
@@ -136,6 +137,10 @@ module AcidicJob
|
|
136
137
|
|
137
138
|
private
|
138
139
|
|
140
|
+
def finish_staged_job
|
141
|
+
FinishedPoint.new.call(run: staged_job_run)
|
142
|
+
end
|
143
|
+
|
139
144
|
def was_workflow_job?
|
140
145
|
defined?(@acidic_job_run) && @acidic_job_run.present?
|
141
146
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: acidic_job
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0.
|
4
|
+
version: 1.0.0.pre25
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- fractaledmind
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-05-
|
11
|
+
date: 2022-05-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|