acidic_job 1.0.0.beta.7 → 1.0.0.beta.8
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/Gemfile.lock +1 -1
- data/lib/acidic_job/mixin.rb +1 -1
- data/lib/acidic_job/processor.rb +4 -3
- data/lib/acidic_job/run.rb +2 -2
- data/lib/acidic_job/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 81769867ab7962af7062bc8714523d8743a629b3e13eb71f6f5561024bfe795c
|
4
|
+
data.tar.gz: bc8ca04208ed63b2a70839490a44102868238df48740a19f7a1d08d19115b29b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f9cc54a6e0956fed6fb57babdca80a95126810dae84d244abbd162e428bb52bb7cc59ccf34e2f5a9fea29ac7ea719919bd2c8f6fbe026e167947a69aae794be3
|
7
|
+
data.tar.gz: eefa772f9f26643ba39048f6d61b460a08b55c635386803df62e476edf3b00c77000380b0b3bf94fbe00b4d11ece3cdd764f07d97ab656e6aa54e41097f7df47
|
data/Gemfile.lock
CHANGED
data/lib/acidic_job/mixin.rb
CHANGED
@@ -227,7 +227,7 @@ module AcidicJob
|
|
227
227
|
|
228
228
|
# "STG__#{idempotency_key}__#{encoded_global_id}"
|
229
229
|
_prefix, _idempotency_key, encoded_global_id = job_id.split("__")
|
230
|
-
staged_job_gid = "gid://#{::Base64.
|
230
|
+
staged_job_gid = "gid://#{::Base64.urlsafe_decode64(encoded_global_id)}"
|
231
231
|
|
232
232
|
@staged_job_run = ::GlobalID::Locator.locate(staged_job_gid)
|
233
233
|
end
|
data/lib/acidic_job/processor.rb
CHANGED
@@ -19,7 +19,7 @@ module AcidicJob
|
|
19
19
|
if !@run.known_recovery_point?
|
20
20
|
raise UnknownRecoveryPoint,
|
21
21
|
"Defined workflow does not reference this step: #{@run.current_step_name.inspect}"
|
22
|
-
elsif
|
22
|
+
elsif (awaited_jobs = jobs_from(@run.current_step_awaits)).any?
|
23
23
|
# We only execute the current step, without progressing to the next step.
|
24
24
|
# This ensures that any failures in parallel jobs will have this step retried in the main workflow
|
25
25
|
step_result = @workflow.execute_current_step
|
@@ -65,10 +65,11 @@ module AcidicJob
|
|
65
65
|
def jobs_from(jobs_or_jobs_getter)
|
66
66
|
case jobs_or_jobs_getter
|
67
67
|
when Array
|
68
|
-
jobs_or_jobs_getter
|
68
|
+
jobs_or_jobs_getter.compact
|
69
69
|
when Symbol, String
|
70
70
|
if @job.respond_to?(jobs_or_jobs_getter, _include_private = true)
|
71
|
-
@job.method(jobs_or_jobs_getter).call
|
71
|
+
jobs = @job.method(jobs_or_jobs_getter).call
|
72
|
+
Array(jobs).compact
|
72
73
|
else
|
73
74
|
raise UnknownAwaitedJob,
|
74
75
|
"Invalid `awaits`; unknown method `#{jobs_or_jobs_getter}` for this job"
|
data/lib/acidic_job/run.rb
CHANGED
@@ -130,7 +130,7 @@ module AcidicJob
|
|
130
130
|
# encode the identifier for this record in the job ID
|
131
131
|
global_id = to_global_id.to_s.remove("gid://")
|
132
132
|
# base64 encoding for minimal security
|
133
|
-
encoded_global_id = Base64.
|
133
|
+
encoded_global_id = Base64.urlsafe_encode64(global_id, padding: false)
|
134
134
|
|
135
135
|
[
|
136
136
|
STAGED_JOB_ID_PREFIX,
|
@@ -174,7 +174,7 @@ module AcidicJob
|
|
174
174
|
end
|
175
175
|
|
176
176
|
def current_step_awaits
|
177
|
-
current_step_hash
|
177
|
+
current_step_hash["awaits"]
|
178
178
|
end
|
179
179
|
|
180
180
|
def next_step_finishes?
|
data/lib/acidic_job/version.rb
CHANGED