Permalink
Browse files

notify support for GodMongrelCluster

  • Loading branch information...
1 parent c528cf7 commit 4773d660979cee50c4216f9419d31ecba7a348fd @jnewland committed Jul 8, 2008
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/god_mongrel_cluster.rb
View
6 lib/god_mongrel_cluster.rb
@@ -41,6 +41,7 @@ def watch(watch_options = {})
start.condition(:process_running) do |c|
c.running = false
c.interval = watch_options[:process_running_interval] || w.interval
+ c.notify = watch_options[:process_running_notify] || watch_options[:notify] || nil
end
end
@@ -49,22 +50,25 @@ def watch(watch_options = {})
c.above = watch_options[:memory_usage] || 200.megabytes
c.times = watch_options[:memory_usage_times] || 1
c.interval = watch_options[:memory_usage_interval] || w.interval
+ c.notify = watch_options[:memory_usage_notify] || watch_options[:notify] || nil
end
restart.condition(:cpu_usage) do |c|
c.above = watch_options[:cpu_usage] || 50.percent
c.times = watch_options[:cpu_usage_times] || 1
c.interval = watch_options[:cpu_usage_interval] || w.interval
+ c.notify = watch_options[:cpu_usage_notify] || watch_options[:notify] || nil
end
restart.condition(:http_response_code) do |c|
c.code_is_not = watch_options[:http_response_code_is_not] || %w(200 304)
- c.host = watch_options[:http_response_code_host] || 'localhost'
+ c.host = watch_options[:http_response_code_host] || '127.0.0.1'
c.path = watch_options[:http_response_code_path] || '/'
c.port = port
c.timeout = watch_options[:http_response_code_timeout] || 30.seconds
c.times = watch_options[:http_response_times] || 1
c.interval = watch_options[:http_response_interval] || w.interval
+ c.notify = watch_options[:http_response_notify] || watch_options[:notify] || nil
end
end

0 comments on commit 4773d66

Please sign in to comment.