Skip to content

Instantly share code, notes, and snippets.

@seth-macpherson
Created September 17, 2012 18:05
Show Gist options
  • Save seth-macpherson/3738812 to your computer and use it in GitHub Desktop.
Save seth-macpherson/3738812 to your computer and use it in GitHub Desktop.
question
@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