henry-container 0.1.52 → 0.1.53
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/henry/container.rb +16 -16
- data/lib/henry/container/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a3500a9632125c1d420d3ac36735f51674a2c4b2
|
4
|
+
data.tar.gz: d17d3427b69354adca379183e9dcf9d51edb79db
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bd434de68e889021ce0f835de2d432bec9a45ed0a6a2b64adaa7ebe342e2ad7f9302490e983caad281b2e98b5a6a0dd418b428691fcbe986211f84b3db7a30f6
|
7
|
+
data.tar.gz: fc93ef037d5f374dc24d936c1f5d9cfbd329ee5b12d101d7ff1695d084d0397c42802c77b00c6f6589c151b1227b78f1175e1d8f87f24220fd2c3afc220b7825
|
data/lib/henry/container.rb
CHANGED
@@ -103,27 +103,27 @@ module Henry
|
|
103
103
|
ensure
|
104
104
|
self.kill_children(Process.pid)
|
105
105
|
end
|
106
|
+
end
|
106
107
|
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
108
|
+
# Kills children processes recursively.
|
109
|
+
#
|
110
|
+
# @params [Integer] pid the pid of the process to be killed.
|
111
|
+
def kill_children(pid)
|
112
|
+
begin
|
113
|
+
children_pids = `ps o pid= --ppid #{pid}`.scan(/\d+/).collect(&:to_i)
|
113
114
|
|
114
|
-
|
115
|
+
return false if pids.count == 1
|
115
116
|
|
116
|
-
|
117
|
-
|
118
|
-
|
117
|
+
children_pids.each do |child_pid|
|
118
|
+
begin
|
119
|
+
Process.kill('KILL', child_pid)
|
119
120
|
|
120
|
-
|
121
|
-
|
122
|
-
end
|
121
|
+
self.kill_children(child_pid)
|
122
|
+
rescue Errno::ESRCH
|
123
123
|
end
|
124
|
-
|
125
|
-
|
126
|
-
|
124
|
+
t g end
|
125
|
+
rescue Errno::ENOENT
|
126
|
+
warn 'Can not cleanup this process children'
|
127
127
|
end
|
128
128
|
end
|
129
129
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: henry-container
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.53
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Roberto Decurnex
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-08-
|
11
|
+
date: 2013-08-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|