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
#Tasks have been added to fully maintain nginx, unicorn, redis, memcached, start resque workers and run any command on any server in the farm. | |
#<pre> | |
#cap nginx:restart # Restart Nginx. | |
#cap nginx:start # Start Nginx. | |
#cap nginx:status # Status of Nginx. | |
#cap nginx:stop # Stop Nginx. | |
#cap nginx:tail_error # Tail the Nginx error logs. | |
#cap unicorn:reload # reload your unicorn servers. | |
#cap unicorn:restart # restart your unicorn servers. | |
#cap unicorn:start # start your unicorn servers. |
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 |
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
ftasks = Resque::Failure.all(0, 1000000) | |
Resque::Failure.clear() | |
ftasks.each do |ftask| | |
queue = ftask["queue"] | |
payload = ftask["payload"] | |
Resque::Job.new(queue, payload).recreate() | |
end |
NewerOlder