einhorn 0.4.4 → 0.4.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -149,17 +149,17 @@ module Einhorn::Command
149
149
  def self.install_handlers
150
150
  Signal.trap("INT") do
151
151
  Einhorn::Command.signal_all("USR2", Einhorn::WorkerPool.workers)
152
- Einhorn::State.respawn = false
152
+ Einhorn::Command.stop_respawning
153
153
  end
154
154
  Signal.trap("TERM") do
155
155
  Einhorn::Command.signal_all("TERM", Einhorn::WorkerPool.workers)
156
- Einhorn::State.respawn = false
156
+ Einhorn::Command.stop_respawning
157
157
  end
158
158
  # Note that quit is a bit different, in that it will actually
159
159
  # make Einhorn quit without waiting for children to exit.
160
160
  Signal.trap("QUIT") do
161
161
  Einhorn::Command.signal_all("QUIT", Einhorn::WorkerPool.workers)
162
- Einhorn::State.respawn = false
162
+ Einhorn::Command.stop_respawning
163
163
  exit(1)
164
164
  end
165
165
  Signal.trap("HUP") {Einhorn::Command.reload}
@@ -167,12 +167,12 @@ module Einhorn::Command
167
167
  Signal.trap("CHLD") {Einhorn::Event.break_loop}
168
168
  Signal.trap("USR2") do
169
169
  Einhorn::Command.signal_all("USR2", Einhorn::WorkerPool.workers)
170
- Einhorn::State.respawn = false
170
+ Einhorn::Command.stop_respawning
171
171
  end
172
172
  at_exit do
173
173
  if Einhorn::State.kill_children_on_exit && Einhorn::TransientState.whatami == :master
174
174
  Einhorn::Command.signal_all("USR2", Einhorn::WorkerPool.workers)
175
- Einhorn::State.respawn = false
175
+ Einhorn::Command.stop_respawning
176
176
  end
177
177
  end
178
178
  end
@@ -353,7 +353,7 @@ EOF
353
353
  signal = args[0] || "USR2"
354
354
 
355
355
  response = Einhorn::Command.signal_all(signal, Einhorn::WorkerPool.workers)
356
- Einhorn::State.respawn = false
356
+ Einhorn::Command.stop_respawning
357
357
 
358
358
  "Einhorn is going down! #{response}"
359
359
  end
@@ -334,6 +334,11 @@ module Einhorn
334
334
  end
335
335
  end
336
336
 
337
+ def self.stop_respawning
338
+ Einhorn::State.respawn = false
339
+ Einhorn::Event.break_loop
340
+ end
341
+
337
342
  def self.replenish
338
343
  return unless Einhorn::State.respawn
339
344
 
@@ -1,3 +1,3 @@
1
1
  module Einhorn
2
- VERSION = '0.4.4'
2
+ VERSION = '0.4.5'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: einhorn
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.4
4
+ version: 0.4.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-03-15 00:00:00.000000000 Z
12
+ date: 2013-03-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake