rjob 0.5.5 → 0.5.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rjob/cli.rb +2 -0
- data/lib/rjob/version.rb +1 -1
- data/lib/rjob/worker_process.rb +17 -5
- metadata +9 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9bebd5026b07c43eca2bc4aacb4d11ea44fc4f5534df2dc4504617bb879f8767
|
4
|
+
data.tar.gz: 40bc336b11fd755eead4b65f08a9e747da34d424e6c7af13ad1d90cfd8d3f355
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ba483620e0863dae21b9b648e17b8e820d4672a79670290d9f32b661793dbf3148cb47c7e54efe4a563c929c908443acdfef46c699f97b889049c6cd74e150c8
|
7
|
+
data.tar.gz: 10cd5379b8e0aea0d2b7e6e0eec1ca66f5bb9e33f477e6ed07994bf7a7f1888fd9d765f99fa7291f107773534760ebf4415b3158aefde9db86b7d1a40891ec05
|
data/lib/rjob/cli.rb
CHANGED
data/lib/rjob/version.rb
CHANGED
data/lib/rjob/worker_process.rb
CHANGED
@@ -37,6 +37,14 @@ class Rjob::WorkerProcess
|
|
37
37
|
@failed_count = Concurrent::AtomicFixnum.new
|
38
38
|
@returned_count = Concurrent::AtomicFixnum.new
|
39
39
|
|
40
|
+
if @context.logger
|
41
|
+
if @context.logger.debug?
|
42
|
+
@context.logger.debug("rjob worker process start with prefix=#{@prefix}, max_threads=#{max_threads}")
|
43
|
+
else
|
44
|
+
@context.logger.info("rjob worker process start")
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
40
48
|
@leader = nil
|
41
49
|
@state = :new
|
42
50
|
end
|
@@ -46,11 +54,11 @@ class Rjob::WorkerProcess
|
|
46
54
|
|
47
55
|
Signal.trap("INT") do
|
48
56
|
if @state == :exiting
|
49
|
-
puts
|
50
|
-
exit
|
57
|
+
puts("Force exit requested. Exiting immediately")
|
58
|
+
exit(1)
|
51
59
|
else
|
52
60
|
@state = :exiting
|
53
|
-
puts
|
61
|
+
puts("Exiting...")
|
54
62
|
end
|
55
63
|
end
|
56
64
|
|
@@ -114,11 +122,13 @@ class Rjob::WorkerProcess
|
|
114
122
|
|
115
123
|
if @state == :exiting
|
116
124
|
if @thread_pool.shutdown?
|
125
|
+
@context.logger.info("rjob successfully exiting now") if @context.logger
|
117
126
|
@state = :exited
|
118
127
|
elsif !@thread_pool.shuttingdown?
|
119
128
|
@thread_pool.shutdown
|
120
129
|
else
|
121
130
|
puts "Waiting shutdown..."
|
131
|
+
@context.logger.info("rjob waiting for shutdown...") if @context.logger
|
122
132
|
end
|
123
133
|
end
|
124
134
|
|
@@ -242,7 +252,7 @@ class Rjob::WorkerProcess
|
|
242
252
|
error = { message: "Unknown error" }
|
243
253
|
end
|
244
254
|
|
245
|
-
if @context.logger
|
255
|
+
if @context.logger&.info?
|
246
256
|
@context.logger.info("Job '#{job.worker_class_name}' with args '#{job.worker_args}' failed: #{error}")
|
247
257
|
end
|
248
258
|
|
@@ -291,7 +301,9 @@ class Rjob::WorkerProcess
|
|
291
301
|
rescue StandardError => e
|
292
302
|
if @context.logger.respond_to?(:error)
|
293
303
|
s = job_processor.respond_to?(:job_str) ? job_processor.job_str : '<unknown>'
|
294
|
-
|
304
|
+
msg = "UGHH! Error while notifying dead job error: #{s}"
|
305
|
+
puts(msg)
|
306
|
+
@context.logger.error(msg) if @context.logger
|
295
307
|
end
|
296
308
|
end
|
297
309
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rjob
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- André D. Piske
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-02-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: oj
|
@@ -45,6 +45,9 @@ dependencies:
|
|
45
45
|
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: 3.0.5
|
48
|
+
- - "<="
|
49
|
+
- !ruby/object:Gem::Version
|
50
|
+
version: '6.0'
|
48
51
|
type: :runtime
|
49
52
|
prerelease: false
|
50
53
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -52,6 +55,9 @@ dependencies:
|
|
52
55
|
- - ">="
|
53
56
|
- !ruby/object:Gem::Version
|
54
57
|
version: 3.0.5
|
58
|
+
- - "<="
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '6.0'
|
55
61
|
- !ruby/object:Gem::Dependency
|
56
62
|
name: msgpack
|
57
63
|
requirement: !ruby/object:Gem::Requirement
|
@@ -146,7 +152,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
146
152
|
- !ruby/object:Gem::Version
|
147
153
|
version: '0'
|
148
154
|
requirements: []
|
149
|
-
rubygems_version: 3.
|
155
|
+
rubygems_version: 3.5.6
|
150
156
|
signing_key:
|
151
157
|
specification_version: 4
|
152
158
|
summary: Asynchronous job processing
|