acidic_job 1.0.0.pre12 → 1.0.0.pre13
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/perform_wrapper.rb +8 -35
- data/lib/acidic_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: ff4783bfe9e3ff6a03683ed14a9f21a5227f6114bc5824cdee71a66f252d7fa1
|
4
|
+
data.tar.gz: d905d8ad1848d77ae9fade6b75527ae113675ba3c39b66149c750f9adb64d83b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1af39ccff6bb5d414ab32344887d60f4cf721d9272ec0c98c9686053d3426fd2da98d82b9fe35fd45ebc6b719b8e1df6ce922abbec86653a91bea736f9522696
|
7
|
+
data.tar.gz: f0f8db378646cd3e948a2406c2237b44c9e6a551dafcbe1a687cbfadc5a15713e3b6a177a18ccf81146b024cb64b44085a14c8250fd8b364f16c911d3a202f5b
|
data/Gemfile.lock
CHANGED
@@ -4,46 +4,19 @@ module AcidicJob
|
|
4
4
|
# NOTE: it is essential that this be a bare module and not an ActiveSupport::Concern
|
5
5
|
module PerformWrapper
|
6
6
|
def perform(*args, **kwargs)
|
7
|
-
|
7
|
+
@__acidic_job_args = args
|
8
|
+
@__acidic_job_kwargs = kwargs
|
8
9
|
|
9
10
|
# we don't want to run the `perform` callbacks twice, since ActiveJob already handles that for us
|
10
|
-
if
|
11
|
-
|
12
|
-
elsif
|
13
|
-
|
11
|
+
if defined?(ActiveJob) && self.class < ActiveJob::Base
|
12
|
+
super(*args, **kwargs)
|
13
|
+
elsif defined?(Sidekiq) && self.class.include?(Sidekiq::Worker)
|
14
|
+
run_callbacks :perform do
|
15
|
+
super(*args, **kwargs)
|
16
|
+
end
|
14
17
|
else
|
15
18
|
raise UnknownJobAdapter
|
16
19
|
end
|
17
20
|
end
|
18
|
-
|
19
|
-
def sk_job?
|
20
|
-
defined?(Sidekiq) && self.class.include?(Sidekiq::Worker)
|
21
|
-
end
|
22
|
-
|
23
|
-
def aj_job?
|
24
|
-
defined?(ActiveJob) && self.class < ActiveJob::Base
|
25
|
-
end
|
26
|
-
|
27
|
-
private
|
28
|
-
|
29
|
-
# don't run `perform` callbacks, as ActiveJob already does this
|
30
|
-
def __acidic_job_perform_for_aj(super_method, *args, **kwargs)
|
31
|
-
__acidic_job_perform_base(super_method, *args, **kwargs)
|
32
|
-
end
|
33
|
-
|
34
|
-
# ensure to run `perform` callbacks
|
35
|
-
def __acidic_job_perform_for_sk(super_method, *args, **kwargs)
|
36
|
-
run_callbacks :perform do
|
37
|
-
__acidic_job_perform_base(super_method, *args, **kwargs)
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
# capture arguments passed to `perform` to be used by AcidicJob later
|
42
|
-
def __acidic_job_perform_base(super_method, *args, **kwargs)
|
43
|
-
@__acidic_job_args = args
|
44
|
-
@__acidic_job_kwargs = kwargs
|
45
|
-
|
46
|
-
super_method.call(*args, **kwargs)
|
47
|
-
end
|
48
21
|
end
|
49
22
|
end
|
data/lib/acidic_job/version.rb
CHANGED
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.pre13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- fractaledmind
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-03-
|
11
|
+
date: 2022-03-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|