chained_job 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/chained_job/config.rb +2 -0
- data/lib/chained_job/process.rb +8 -2
- data/lib/chained_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: 2754a3795b49b29119699d834fa7fd30a3618c5c9b9e4e13c0d806f1e681b1c7
|
4
|
+
data.tar.gz: cd5a4e01156701bb5c232a67d1731bc592b4caafd3bc1c09ec11e23acb10efd3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 012b685a5f4b0a457d70125e4d49f1fba4634650ec8b684d34cffafe35b4327807de56670ec6026ec87a773fdb641477452474205629104be846d6757ff9444c
|
7
|
+
data.tar.gz: 122694c013a12d28b1c781b8b593bcf7e1dd40209642d8c3879a69821792c0258dadaf0f7b3b1dd06990ae802489256699a42abbb8eed2cadbfe2e3efc0099dc
|
data/lib/chained_job/config.rb
CHANGED
@@ -13,6 +13,7 @@ module ChainedJob
|
|
13
13
|
:around_start_chains,
|
14
14
|
:around_chain_process,
|
15
15
|
:around_array_of_job_arguments,
|
16
|
+
:after_worker_finished,
|
16
17
|
:debug,
|
17
18
|
:logger,
|
18
19
|
:redis,
|
@@ -28,6 +29,7 @@ module ChainedJob
|
|
28
29
|
self.around_start_chains = ->(_options, &block) { block.call }
|
29
30
|
self.around_chain_process = ->(_options, &block) { block.call }
|
30
31
|
self.around_array_of_job_arguments = ->(_options, &block) { block.call }
|
32
|
+
self.after_worker_finished = ->(_options) {}
|
31
33
|
|
32
34
|
self.debug = true
|
33
35
|
end
|
data/lib/chained_job/process.rb
CHANGED
@@ -18,7 +18,7 @@ module ChainedJob
|
|
18
18
|
|
19
19
|
def run
|
20
20
|
with_hooks do
|
21
|
-
return
|
21
|
+
return finished_worker unless argument
|
22
22
|
|
23
23
|
job_instance.process(argument)
|
24
24
|
job_instance.class.perform_later(worker_id, job_tag)
|
@@ -32,7 +32,13 @@ module ChainedJob
|
|
32
32
|
end
|
33
33
|
|
34
34
|
def options
|
35
|
-
{ job_class: job_instance.class, worker_id: worker_id }
|
35
|
+
@options ||= { job_class: job_instance.class, worker_id: worker_id }
|
36
|
+
end
|
37
|
+
|
38
|
+
def finished_worker
|
39
|
+
log_finished_worker
|
40
|
+
|
41
|
+
ChainedJob.config.after_worker_finished&.call(options)
|
36
42
|
end
|
37
43
|
|
38
44
|
def log_finished_worker
|
data/lib/chained_job/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chained_job
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mantas Kūjalis
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2020-10-
|
12
|
+
date: 2020-10-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|