acidic_job 0.7.2 → 0.7.3
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/deliver_transactionally_extension.rb +7 -5
- data/lib/acidic_job/perform_wrapper.rb +0 -2
- data/lib/acidic_job/version.rb +1 -1
- data/lib/acidic_job.rb +2 -4
- 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: 7dd5ef2a75562917c4bc4340c794ba8d0bfe8cd16e16f87648281e55915cc415
|
4
|
+
data.tar.gz: beccac205aeac449f163a3474b0f0d906b0331a8f5495c3f48883378c3d08392
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8bef8f4e65efa86de60a3d44bdf2cfff86593a6da6bd7f6cc0c7261272b8fdb775f95bfee2990c1f7d03681fe182b1b54bbe8449cf068b8a97f2d54144b75bec
|
7
|
+
data.tar.gz: b5ad802967a4f5096fcffd6ee682c429d70194b9c4b549e2542fcc7be8206e0e3b7111824815c2f207504307af4a644bd81020a5be3ac6416728bebafa8c1c84
|
data/Gemfile.lock
CHANGED
@@ -2,7 +2,8 @@
|
|
2
2
|
|
3
3
|
module AcidicJob
|
4
4
|
module DeliverTransactionallyExtension
|
5
|
-
|
5
|
+
# rubocop:disable Metrics/MethodLength
|
6
|
+
def deliver_transactionally(_options = {})
|
6
7
|
job = delivery_job_class
|
7
8
|
|
8
9
|
attributes = {
|
@@ -11,14 +12,15 @@ module AcidicJob
|
|
11
12
|
}
|
12
13
|
|
13
14
|
job_args = if job <= ActionMailer::Parameterized::MailDeliveryJob
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
15
|
+
[@mailer_class.name, @action.to_s, "deliver_now", { params: @params, args: @args }]
|
16
|
+
else
|
17
|
+
[@mailer_class.name, @action.to_s, "deliver_now", @params, *@args]
|
18
|
+
end
|
18
19
|
|
19
20
|
attributes[:job_args] = job.new(job_args).serialize
|
20
21
|
|
21
22
|
AcidicJob::Staged.create!(attributes)
|
22
23
|
end
|
24
|
+
# rubocop:enable Metrics/MethodLength
|
23
25
|
end
|
24
26
|
end
|
@@ -18,7 +18,6 @@ module AcidicJob
|
|
18
18
|
|
19
19
|
private
|
20
20
|
|
21
|
-
# rubocop:disable Metrics/AbcSize
|
22
21
|
def set_arguments_for_perform(*args, **kwargs)
|
23
22
|
# store arguments passed into `perform` so that we can later persist
|
24
23
|
# them to `AcidicJob::Key#job_args` for both ActiveJob and Sidekiq::Worker
|
@@ -32,6 +31,5 @@ module AcidicJob
|
|
32
31
|
[]
|
33
32
|
end
|
34
33
|
end
|
35
|
-
# rubocop:enable Metrics/AbcSize
|
36
34
|
end
|
37
35
|
end
|
data/lib/acidic_job/version.rb
CHANGED
data/lib/acidic_job.rb
CHANGED
@@ -25,9 +25,7 @@ module AcidicJob
|
|
25
25
|
# Extend ActiveJob with `perform_transactionally` class method
|
26
26
|
klass.include PerformTransactionallyExtension
|
27
27
|
|
28
|
-
if defined?(ActionMailer)
|
29
|
-
ActionMailer::Parameterized::MessageDelivery.include DeliverTransactionallyExtension
|
30
|
-
end
|
28
|
+
ActionMailer::Parameterized::MessageDelivery.include DeliverTransactionallyExtension if defined?(ActionMailer)
|
31
29
|
|
32
30
|
# Ensure our `perform` method always runs first to gather parameters
|
33
31
|
klass.prepend PerformWrapper
|
@@ -95,7 +93,7 @@ module AcidicJob
|
|
95
93
|
recovery_point = @key.recovery_point.to_s
|
96
94
|
current_step = @key.workflow[recovery_point]
|
97
95
|
|
98
|
-
if recovery_point == Key::RECOVERY_POINT_FINISHED.to_s
|
96
|
+
if recovery_point == Key::RECOVERY_POINT_FINISHED.to_s # rubocop:disable Style/GuardClause
|
99
97
|
break
|
100
98
|
elsif current_step.nil?
|
101
99
|
raise UnknownRecoveryPoint, "Defined workflow does not reference this step: #{recovery_point}"
|