Created
September 17, 2012 18:05
-
-
Save seth-macpherson/3738812 to your computer and use it in GitHub Desktop.
question
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@analytics_status = EntityStore[:last_analytics_check] | |
if Time.now() > @analytics_status[:date] + 24.hours || @analytics_status[:status] == "FAIL" | |
rc = Alert.count | |
unless rc > W@analytics_status[:count] | |
@analytics_status[:status] = "FAIL" | |
else | |
@analytics_status[:status] = "OK" | |
@analytics_status[:count] = rc | |
end | |
@analytics_status[:date] = Time.now | |
EntityStore[:last_analytics_check] = @analytics_status | |
end | |
if Alert.count > 50 | |
notify_airbrake(:error_message => "Job Queue count of #{Alert.count} suggests error occurred") | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment