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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cd4650c1710db962640dcdafd9f9ed5673b09dc3938b14f3cc3285110e0ac576
4
- data.tar.gz: b8e243c78492f7aedaaaefa2a3dfff639267d19c47939f24f45bac22bd534c77
3
+ metadata.gz: 9ad35b931510d3d138d9e9d9f615421150980b28c70478d55303acd36284dc68
4
+ data.tar.gz: 77a470c49f48a0c7100034e38f46a45d4b31c36d4285e881e4604b89b44011bb
5
5
  SHA512:
6
- metadata.gz: 54a8f4f9bcf9d67b1e7f74e0e0dee25f53e46312950e0eab9868088d1bdaf8d841f621676c2c2fc0703df590fe677380a8b63eaee3d53e3c10ef584597e50e10
7
- data.tar.gz: 2e6e2590ed99bafa326e73cc32d3eb08840be94d48cb7cf0251dfc17c7a9f41907a75da08dabfd415f416d05aa432187d2ad78460527bda2c2df3de2742d7f77
6
+ metadata.gz: a070140349676442884f879622fd5398fa83c912187fa07f1ab231c38ef7c9d6a04ad485ff6c83b708e6fae31401a6a3aa5e554c3fa11fa7dc89bfe69c29ede2
7
+ data.tar.gz: e3cb216bcb2f0cdc886733ca8f00efd284873aa828e9f55e26138c688e6ac7cb182aec0da663defd117f26d1f3062901a2c0f1f6eec39275d6dcc58188d2e3c5
@@ -1,3 +1,3 @@
1
1
  module Delayed
2
- VERSION = "0.15.11"
2
+ VERSION = "0.15.12"
3
3
  end
@@ -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
- health_check.stop
142
- work_queue.close
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.11
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-29 00:00:00.000000000 Z
12
+ date: 2019-07-31 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord