File: process_thin.rb

package info (click to toggle)
ruby-eye 0.7-5.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 672 kB
  • sloc: ruby: 5,003; makefile: 3
file content (30 lines) | stat: -rw-r--r-- 699 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# part of thin-farm.eye config

def thin(proxy, port)
  name = "thin-#{port}"

  opts = [
    "-l thins.log",
    "-p #{port}",
    "-P #{name}.pid",
    "-d",
    "-R thin.ru",
    "--tag #{proxy.app.name}.#{proxy.name}",
    "-t 60",
    "-e #{proxy.env['RAILS_ENV']}",
    "-c #{proxy.working_dir}",
    "-a 127.0.0.1"
  ]

  proxy.process(name) do
    pid_file "#{name}.pid"

    start_command "#{BUNDLE} exec thin start #{opts * ' '}"
    stop_signals [:QUIT, 2.seconds, :TERM, 1.seconds, :KILL]

    stdall "thin.stdall.log"

    check :http, :url => "http://127.0.0.1:#{port}/hello", :pattern => /World/,
                 :every => 5.seconds, :times => [2, 3], :timeout => 1.second
  end
end