uc 0.1.10 → 0.2.0
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/lib/uc/config.rb +6 -1
- data/lib/uc/server.rb +9 -0
- data/lib/uc/templates/unicorn.erb +5 -0
- data/lib/uc/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 56f5b194b95797f2d533561b497e78a6f4db8316
|
4
|
+
data.tar.gz: e6aa5f2d280d2a9aaeba67eec5baa0e043e437a0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4272cad7ed70ad7a14df4204e1a1530a0426dc961ce4ca0f93d333587e65f8b7f37a746a483e658741358600a011940347fd273f37df838c726cdb2fa64480a4
|
7
|
+
data.tar.gz: b511b802494945888ccc6d3f4d5e1e08186c7f82c58e34fcf39a69dd256489948f49b3089c8a21f42f00a2d8a136b637c085de4df9049f26235042add85fcafd
|
data/lib/uc/config.rb
CHANGED
@@ -24,7 +24,8 @@ module Uc
|
|
24
24
|
prestart_url: "/",
|
25
25
|
working_dir: @app_dir,
|
26
26
|
event_queue: "unicorn_#{Process.uid}",
|
27
|
-
ready_wait: 5
|
27
|
+
ready_wait: 5,
|
28
|
+
listen: []
|
28
29
|
}
|
29
30
|
read_from_file
|
30
31
|
return @config
|
@@ -34,6 +35,10 @@ module Uc
|
|
34
35
|
config
|
35
36
|
end
|
36
37
|
|
38
|
+
def listen(*ports)
|
39
|
+
config[:listen] = ports
|
40
|
+
end
|
41
|
+
|
37
42
|
def ready_wait(wait_timeout)
|
38
43
|
config[:ready_wait] = wait_timeout.to_i
|
39
44
|
end
|
data/lib/uc/server.rb
CHANGED
@@ -28,6 +28,10 @@ module Uc
|
|
28
28
|
puts server_status
|
29
29
|
return
|
30
30
|
end
|
31
|
+
if config[:instances] == 0
|
32
|
+
puts "wont start 0 instances"
|
33
|
+
return
|
34
|
+
end
|
31
35
|
ENV["UNICORN_APP_DIR"] = config.app_dir
|
32
36
|
event_stream.expect :fin do
|
33
37
|
cmd %{unicorn -c #{uconfig.path} -D -E #{rails_env} }, return_output: false,
|
@@ -57,6 +61,11 @@ module Uc
|
|
57
61
|
|
58
62
|
def rolling_restart
|
59
63
|
init_once
|
64
|
+
if config[:instances] == 0
|
65
|
+
puts "0 instances specified: stopping"
|
66
|
+
stop
|
67
|
+
return
|
68
|
+
end
|
60
69
|
uconfig.generate_once
|
61
70
|
if not server_status.running?
|
62
71
|
start
|
@@ -5,6 +5,11 @@ worker_processes <%= config.fetch :instances %>
|
|
5
5
|
working_directory "<%= paths.app_dir %>"
|
6
6
|
timeout <%= config.fetch :timeout %>
|
7
7
|
listen "<%= paths.socket %>" , :backlog => <%= config.fetch :queue_size %>
|
8
|
+
|
9
|
+
<% config.fetch(:listen).each do |port| %>
|
10
|
+
listen <%= port %>
|
11
|
+
<% end %>
|
12
|
+
|
8
13
|
pid "<%= paths.pid_file %>"
|
9
14
|
stdout_path "<%= paths.stdout_log %>"
|
10
15
|
stderr_path "<%= paths.stderr_log %>"
|
data/lib/uc/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: uc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Neeraj
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-08-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -114,7 +114,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
114
114
|
version: '0'
|
115
115
|
requirements: []
|
116
116
|
rubyforge_project:
|
117
|
-
rubygems_version: 2.
|
117
|
+
rubygems_version: 2.4.5.1
|
118
118
|
signing_key:
|
119
119
|
specification_version: 4
|
120
120
|
summary: Unicorn controller
|