aboutsummaryrefslogtreecommitdiff
path: root/lib/mauve/person.rb
diff options
context:
space:
mode:
authorPatrick J Cherry <patrick@bytemark.co.uk>2011-08-10 16:09:08 +0100
committerPatrick J Cherry <patrick@bytemark.co.uk>2011-08-10 16:09:08 +0100
commitf1608b8098d0302f7e5c0e7989c78fa310d7d424 (patch)
treef4e1a9a9a5f6c0873bc568c96a21fbade7170104 /lib/mauve/person.rb
parenta54a32084e9870af6f1ede97887c2332c21e812c (diff)
Removed MauveTime. Added more tests.
Diffstat (limited to 'lib/mauve/person.rb')
-rw-r--r--lib/mauve/person.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/mauve/person.rb b/lib/mauve/person.rb
index 58d696c..9d541a9 100644
--- a/lib/mauve/person.rb
+++ b/lib/mauve/person.rb
@@ -159,7 +159,7 @@ module Mauve
end
def do_send_alert(level, alert)
- now = MauveTime.now
+ now = Time.now
was_suppressed = self.suppressed?
@@ -168,7 +168,7 @@ module Mauve
# Choose the second one as the first.
#
first = previous_alert_times[1]
- first.is_a?(MauveTime) and (now - first) < period
+ first.is_a?(Time) and (now - first) < period
end
if self.suppressed?
@@ -179,7 +179,7 @@ module Mauve
end
- if Server.instance.started_at > alert.updated_at.to_time and (Server.instance.started_at + Server.instance.initial_sleep) > MauveTime.now
+ if Server.instance.started_at > alert.updated_at.to_time and (Server.instance.started_at + Server.instance.initial_sleep) > Time.now
logger.info("Alert last updated in prior run of mauve -- ignoring for initial sleep period.")
return true
end
@@ -211,7 +211,7 @@ module Mauve
#
# Hmm.. not sure how to make this thread-safe.
#
- @notification_thresholds[period].push MauveTime.now
+ @notification_thresholds[period].push Time.now
@notification_thresholds[period].shift
end
true