Skip to content
This repository was archived by the owner on May 14, 2021. It is now read-only.

Commit bb7d976

Browse files
logikalsethvargo
authored andcommitted
[COOK-3377] Add configurable wait time to runit scripts
Signed-off-by: Seth Vargo <sethvargo@gmail.com>
1 parent 833e6b7 commit bb7d976

3 files changed

Lines changed: 5 additions & 2 deletions

File tree

providers/unicorn.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@
8686
:bundler => new_resource.bundler,
8787
:bundle_command => new_resource.bundle_command,
8888
:rails_env => new_resource.environment_name,
89-
:smells_like_rack => ::File.exists?(::File.join(new_resource.path, "current", "config.ru"))
89+
:smells_like_rack => ::File.exists?(::File.join(new_resource.path, "current", "config.ru")),
90+
:runit_wait_time => new_resource.runit_wait_time
9091
)
9192
end
9293

resources/unicorn.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
attribute :unicorn_command_line, :kind_of => [String, NilClass], :default => nil
3939
attribute :copy_on_write, :kind_of => [TrueClass, FalseClass], :default => false
4040
attribute :enable_stats, :kind_of => [TrueClass, FalseClass], :default => false
41+
attribute :runit_wait_time, :kind_of => Integer, :default => 7
4142

4243
def options(*args, &block)
4344
@options ||= Mash[:tcp_nodelay => true, :backlog => 100]

templates/default/sv-unicorn-run.erb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ exec <%= node[:runit][:chpst_bin] %> \
88
<%= @options[:bundler] ? "#{@options[:bundle_command]} exec" : '' %> \
99
<%= @options[:smells_like_rack] ? 'unicorn' : 'unicorn_rails' %> \
1010
-E <%= @options[:rails_env] %> \
11-
-c /etc/unicorn/<%= @options[:app].application.name %>.rb
11+
-c /etc/unicorn/<%= @options[:app].application.name %>.rb \
12+
-w <%= @options[:runit_wait_time] %>

0 commit comments

Comments
 (0)