Skip to content

Instantly share code, notes, and snippets.

@danhodge
Last active October 24, 2018 13:32
Show Gist options
  • Save danhodge/a8f44ea7296b9731b51743aa49b897d8 to your computer and use it in GitHub Desktop.
Save danhodge/a8f44ea7296b9731b51743aa49b897d8 to your computer and use it in GitHub Desktop.
Resque Basics
# Add following to enable debug logging of Resque internals
Resque.logger = Logger.new(STDOUT)
Resque.logger.level = Logger::DEBUG
# Use resque-retry plugin for automatic retries
class SomeJob
extend Resque::Plugins::Retry
end
# The scheduler process must be running to perform retries - if not running, the job
# will run and fail and be rescheduled but never be retried
# Stop using inline scheduler to do realistic testing in development
# Comment out this line:
Resque.inline = Rails.env == 'development' || Rails.env == 'test'
# Redis snapshots are periodically written to the file /usr/local/var/db/redis/dump.rdb,
# restart Redis after deleting that file to clear out any unwanted state
# Look at all failed jobs
Resque::Failure.all(0, Resque::Failure.count)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment