inst-jobs 0.15.11 → 0.15.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/delayed/version.rb +1 -1
- data/lib/delayed/worker.rb +16 -2
- 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: 9ad35b931510d3d138d9e9d9f615421150980b28c70478d55303acd36284dc68
|
4
|
+
data.tar.gz: 77a470c49f48a0c7100034e38f46a45d4b31c36d4285e881e4604b89b44011bb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a070140349676442884f879622fd5398fa83c912187fa07f1ab231c38ef7c9d6a04ad485ff6c83b708e6fae31401a6a3aa5e554c3fa11fa7dc89bfe69c29ede2
|
7
|
+
data.tar.gz: e3cb216bcb2f0cdc886733ca8f00efd284873aa828e9f55e26138c688e6ac7cb182aec0da663defd117f26d1f3062901a2c0f1f6eec39275d6dcc58188d2e3c5
|
data/lib/delayed/version.rb
CHANGED
data/lib/delayed/worker.rb
CHANGED
@@ -118,6 +118,7 @@ class Worker
|
|
118
118
|
when :INT, :TERM
|
119
119
|
@exit = true # get the main thread to bail early if it's waiting for a job
|
120
120
|
work_thread.raise(SystemExit) # Force the main thread to bail out of the current job
|
121
|
+
cleanup! # we're going to get SIGKILL'd in a moment, so clean up asap
|
121
122
|
break
|
122
123
|
when :QUIT
|
123
124
|
@exit = true
|
@@ -138,13 +139,26 @@ class Worker
|
|
138
139
|
Rails.logger.fatal("Child process died: #{e.inspect}") rescue nil
|
139
140
|
self.class.lifecycle.run_callbacks(:exceptional_exit, self, e) { }
|
140
141
|
ensure
|
141
|
-
|
142
|
-
|
142
|
+
cleanup!
|
143
|
+
|
143
144
|
if signal_processor
|
144
145
|
signal_processor.kill
|
145
146
|
signal_processor.join
|
146
147
|
end
|
148
|
+
end
|
149
|
+
|
150
|
+
def cleanup!
|
151
|
+
return if cleaned?
|
152
|
+
|
153
|
+
health_check.stop
|
154
|
+
work_queue.close
|
147
155
|
Delayed::Job.clear_locks!(name)
|
156
|
+
|
157
|
+
@cleaned = true
|
158
|
+
end
|
159
|
+
|
160
|
+
def cleaned?
|
161
|
+
@cleaned
|
148
162
|
end
|
149
163
|
|
150
164
|
def run
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: inst-jobs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.15.
|
4
|
+
version: 0.15.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tobias Luetke
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2019-07-
|
12
|
+
date: 2019-07-31 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activerecord
|