fixed meddle threading, added gravatar.god example config
[god.git] / examples / gravatar.god
blob3f9511dbe888167ce1c2372d630b437826dcec2b
1 # This is the actual config file used to keep the mongrels of
2 # gravatar.com running.
4 RAILS_ROOT = "/var/www/gravatar2/current"
6 God.meddle do |god|
7   god.interval = 30 # seconds
9   %w{8200 8201 8202}.each do |port|
10     god.watch do |w|
11       w.name = "gravatar2-mongrel-#{port}"
12       w.cwd = RAILS_ROOT
13       w.start = "mongrel_rails cluster::start --only #{port}"
14       w.stop = "mongrel_rails cluster::stop --only #{port}"
16       w.start_if do |start|
17         start.condition(:process_not_running) do |c|
18           c.pid_file = File.join(RAILS_ROOT, "log/mongrel.#{port}.pid")
19         end
20       end
21     end
22   end
23 end