sponges 0.3.2 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -40,7 +40,8 @@ module Sponges
40
40
  def on_fork
41
41
  end
42
42
 
43
- def clear
43
+ def clear(name)
44
+ pids.clear
44
45
  end
45
46
 
46
47
  private
@@ -53,6 +53,7 @@ module Sponges
53
53
  def clear(name)
54
54
  hostname_store[:worker][name][:supervisor].del
55
55
  hostname_store[:workers].srem name
56
+ hostname_store[:worker][name][:pids].del
56
57
  end
57
58
 
58
59
  def on_fork
@@ -53,6 +53,7 @@ module Sponges
53
53
  Sponges.logger.warn "Supervisor decrement child's pool by one."
54
54
  if store.children_pids.first
55
55
  kill_one(store.children_pids.first, :HUP)
56
+ store.delete_children(children_pids.first)
56
57
  else
57
58
  Sponges.logger.warn "No more child to kill."
58
59
  end
@@ -87,15 +88,14 @@ module Sponges
87
88
 
88
89
  def kill_them_all(signal)
89
90
  store.children_pids.each do |pid|
90
- kill_one(pid, signal)
91
+ kill_one(pid.to_i, signal)
91
92
  end
92
93
  end
93
94
 
94
95
  def kill_one(pid, signal)
95
96
  begin
96
- Process.kill signal, pid.to_i
97
- Process.waitpid pid.to_i
98
- store.delete_children pid
97
+ Process.kill signal, pid
98
+ Process.waitpid pid
99
99
  Sponges.logger.info "Child #{pid} receive a #{signal} signal."
100
100
  rescue Errno::ESRCH => e
101
101
  # Don't panic
@@ -1,4 +1,4 @@
1
1
  # encoding: utf-8
2
2
  module Sponges
3
- VERSION = "0.3.2"
3
+ VERSION = "0.3.3"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sponges
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
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: 2012-12-24 00:00:00.000000000 Z
12
+ date: 2012-12-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: boson