unicorn-worker-killer 0.3.5 → 0.3.6
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.
- checksums.yaml +4 -4
- data/ChangeLog +4 -0
- data/VERSION +1 -1
- data/lib/unicorn/worker_killer.rb +12 -5
- 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: 472f5a54002c4f7d424ef88e613bce3b8d0b6a12
|
4
|
+
data.tar.gz: 50cf272d41b6cd9bbbd9d3e2218fe189c2aac5d6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7a5a124e1b518ebb417abc8a14f6a93202a816973a6b69073b050072193c082d071a6f6ca418b04b15b211f80327e643cccf3534452a33286df916a2aa6050bd
|
7
|
+
data.tar.gz: 65bb35218c266c2264d90d71c641ea872eba204a6420b98173256f67454cb301ad9170099e54e4c340c66adc2e53f54fa74d98f2bc77f334339ffb57cc59fafa
|
data/ChangeLog
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.6
|
@@ -1,6 +1,10 @@
|
|
1
1
|
require 'unicorn/configuration'
|
2
2
|
|
3
3
|
module Unicorn::WorkerKiller
|
4
|
+
class << self
|
5
|
+
attr_accessor :configuration
|
6
|
+
end
|
7
|
+
|
4
8
|
# Self-destruction by sending the signals to myself. The process sometimes
|
5
9
|
# doesn't terminate by SIGQUIT, so this tries to send SIGTERM and SIGKILL
|
6
10
|
# if it doesn't finish immediately.
|
@@ -41,11 +45,11 @@ module Unicorn::WorkerKiller
|
|
41
45
|
end
|
42
46
|
app # pretend to be Rack middleware since it was in the past
|
43
47
|
end
|
44
|
-
|
48
|
+
|
45
49
|
def randomize(integer)
|
46
50
|
RUBY_VERSION > "1.9" ? Random.rand(integer) : rand(integer)
|
47
51
|
end
|
48
|
-
|
52
|
+
|
49
53
|
def process_client(client)
|
50
54
|
super(client) # Unicorn::HttpServer#process_client
|
51
55
|
return if @_worker_memory_limit_min == 0 && @_worker_memory_limit_max == 0
|
@@ -64,6 +68,7 @@ module Unicorn::WorkerKiller
|
|
64
68
|
end
|
65
69
|
|
66
70
|
private
|
71
|
+
|
67
72
|
def _worker_rss
|
68
73
|
proc_status = "/proc/#{Process.pid}/status"
|
69
74
|
if File.exists? proc_status
|
@@ -110,6 +115,10 @@ module Unicorn::WorkerKiller
|
|
110
115
|
app # pretend to be Rack middleware since it was in the past
|
111
116
|
end
|
112
117
|
|
118
|
+
def randomize(integer)
|
119
|
+
RUBY_VERSION > "1.9" ? Random.rand(integer) : rand(integer)
|
120
|
+
end
|
121
|
+
|
113
122
|
def process_client(client)
|
114
123
|
super(client) # Unicorn::HttpServer#process_client
|
115
124
|
return if @_worker_max_requests_min == 0 && @_worker_max_requests_max == 0
|
@@ -129,7 +138,5 @@ module Unicorn::WorkerKiller
|
|
129
138
|
yield(configuration) if block_given?
|
130
139
|
end
|
131
140
|
|
132
|
-
|
133
|
-
attr_accessor :configuration
|
134
|
-
end
|
141
|
+
self.configure
|
135
142
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unicorn-worker-killer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kazuki Ohta
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-03-
|
12
|
+
date: 2013-03-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: unicorn
|