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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1de4a3b3e8be5af5e5f17b5c569c3851b9ed5c7ee94cd38fc7d7b61b1f6035ea
4
- data.tar.gz: 5bc34fa2eee95a23a667c21c5373318e48e16eaa559f123b05d41be3525ac9a1
3
+ metadata.gz: 9bebd5026b07c43eca2bc4aacb4d11ea44fc4f5534df2dc4504617bb879f8767
4
+ data.tar.gz: 40bc336b11fd755eead4b65f08a9e747da34d424e6c7af13ad1d90cfd8d3f355
5
5
  SHA512:
6
- metadata.gz: de1b0664b64a4503cc525be2c37e5abc200f0b92505100917f1aacdffb16a5a68f7f708e90abf64a0fd07530afb72c44a16aee64e9fd192706529af768cf7391
7
- data.tar.gz: b37d75d2595f979ce02f8279fbd38a4ccea283e4baaeee303402a969424c473567e907c581302a6f826f02a765570bfd4f200d043485a5825327f8bcb0bb1ca0
6
+ metadata.gz: ba483620e0863dae21b9b648e17b8e820d4672a79670290d9f32b661793dbf3148cb47c7e54efe4a563c929c908443acdfef46c699f97b889049c6cd74e150c8
7
+ data.tar.gz: 10cd5379b8e0aea0d2b7e6e0eec1ca66f5bb9e33f477e6ed07994bf7a7f1888fd9d765f99fa7291f107773534760ebf4415b3158aefde9db86b7d1a40891ec05
data/lib/rjob/cli.rb CHANGED
@@ -26,6 +26,8 @@ class Rjob::CLI
26
26
  require r
27
27
  end
28
28
 
29
+ Rjob::Context.instance.logger.info("Booting up rjob") if Rjob::Context.instance.logger
30
+
29
31
  run_workers if @run_workers
30
32
  end
31
33
 
data/lib/rjob/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
 
2
2
  module Rjob
3
- VERSION = "0.5.5".freeze
3
+ VERSION = "0.5.6".freeze
4
4
  end
@@ -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 "Force exit requested. Exiting immediately"
50
- exit 1
57
+ puts("Force exit requested. Exiting immediately")
58
+ exit(1)
51
59
  else
52
60
  @state = :exiting
53
- puts "Exiting..."
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.respond_to?(:info)
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
- @context.logger.error("UGHH! Error while notifying dead job error: #{s}")
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.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: 2023-10-12 00:00:00.000000000 Z
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.4.20
155
+ rubygems_version: 3.5.6
150
156
  signing_key:
151
157
  specification_version: 4
152
158
  summary: Asynchronous job processing