Permalink
Browse files

Merge pull request #85 from railsmachine/mysql-replication-ruby-19

Add Ruby 1.9 compatability to MySQL Replication Monitor
  • Loading branch information...
2 parents 2ff6588 + 78079db commit 0e8b89738f7747a26a37b86c292e6fb9797f80a6 @itsderek23 itsderek23 committed Mar 27, 2013
Showing with 5 additions and 5 deletions.
  1. +5 −5 mysql_replication_monitor/mysql_replication_monitor.rb
@@ -42,14 +42,14 @@ def build_report
if h.nil?
error("Replication not configured")
else
- if h["Seconds_Behind_Master"].nil? and !down_at
+ if h["Seconds_Behind_Master"].nil? && !down_at
if in_ignore_window?
res["Replication Running"]=1
else
res["Replication Running"]=0
down_at = Time.now
end
- elsif h["Slave_IO_Running"] == "Yes" and h["Slave_SQL_Running"] == "Yes"
+ elsif h["Slave_IO_Running"] == "Yes" && h["Slave_SQL_Running"] == "Yes"
res["Seconds Behind Master"] = h["Seconds_Behind_Master"]
res["Replication Running"]=1
down_at = nil if down_at
@@ -75,13 +75,13 @@ def in_ignore_window?
end_time = Time.parse("#{Date.today} #{e}")
if start_time < end_time
- return Time.now > start_time and Time.now < end_time
+ return Time.now > start_time && Time.now < end_time
else
- return Time.now > start_time or Time.now < end_time
+ return Time.now > start_time || Time.now < end_time
end
else
false
end
end
-end
+end

0 comments on commit 0e8b897

Please sign in to comment.