Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 27 lines (22 sloc) 0.604 kb
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
God.watch do |w|
  w.name = "sinatra"
  w.interval = 5.seconds
  w.start = 'ruby ' + File.dirname(__FILE__) + '/scripts/sinatra.rb -p 8888'
  w.grace = 10.seconds

  w.start_if do |start|
    start.condition(:process_running) do |c|
      c.running = false
    end
  end

  w.restart_if do |restart|
    restart.condition(:memory_usage) do |c|
      c.above = 15.megabytes
    end

    restart.condition(:http_response_code) do |c|
      c.host = 'localhost'
      c.port = '8888'
      c.path = '/heartbeat'
      c.code_is_not = %w(200 301 302)
    end
  end

end
Something went wrong with that request. Please try again.