This file contains 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
module Resque | |
## | |
# Resque StateMachine | |
# | |
# Is a Mash to be used in a resque queue. The create method will | |
# initiate the object and enqueue it. | |
# | |
# Can pass in a run_at attribute to delay the run. | |
# Can pass in a test_mode attribute to force test mode. | |
# |
This file contains 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 GetEventResult | |
@queue = :events | |
def self.perform(event_id, attempt=0) | |
event = Event.find(event_id) | |
Rails.logger.info "Fetching results for event ##{event.id} (#{event.name})..." | |
begin | |
results = EventImporter.new(event.datetime.to_date).get_results(event) | |
rescue OpenURI::HTTPError |
NewerOlder