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
class RetryMonitor | |
include Sidekiq::Worker | |
def perform | |
retry_queue = Sidekiq::RetrySet.new | |
if retry_queue.size > 0 | |
# Send an email or do something else. | |
end | |
end | |
end |
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
Example of a working query | |
db.postalCode.find( { 'geo' :{ $near :{ $geometry :{ type : "Point" ,coordinates : [ -94.58, 39.09 ] } ,$maxDistance : 10000} } } ); | |
GIS Standard: <Longitude,Latitude> | |
db.businesses.count( { 'geo' :{ $near :{ $geometry :{ type : "Point" ,coordinates : [ -94.595033, 39.102704 ] } ,$maxDistance : 4000} } } ); | |
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
out = [] | |
Facility.find_each do |facility| | |
if facility.send(:belong_to_billable_company?) && facility.facility_map.geometric_objects.count > 10 | |
out << "#{facility.company.name}, #{facility.name} has #{facility.facility_map.geometric_objects.count} objects" | |
end | |
end | |
facilities_receiving_texts = SMSReceivedEvent.pluck(:facility_id).uniq.length | |
facilities_sending_texts = SMSSentEvent.pluck(:facility_id).uniq.length | |
sms_received = SMSReceivedEvent.count |
OlderNewer