resque-job_timeout
A Resque plugin. Requires Resque ~> 2.0.
Resque plugin allowing long-running jobs to automatically fail after a specified time.
Installation
Add this line to your application's Gemfile:
gem 'resque-job_timeout'
And then execute:
$ bundle install
Or install it yourself as:
$ gem install resque-job_timeout
Usage
Extend your job with this gem.
require 'resque/job_timeout'
class ExampleJob
extend Resque::Plugins::JobTimeout
@queue = :example_queue
def self.perform(*args)
# magic goes here.
end
end
Configuration
Default timeout is 300 seconds. You can modify it by setting in your configuration
Resque::Plugins::JobTimeout.timeout = 1.hour
Development
After checking out the repo, run bundle install
to install dependencies. Then, run bundle exec rake
to run the tests. A running Redis exposed on 127.0.0.1:6379
is needed.
Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/and9000/resque-job_timeout.
Credits
This gem has been inspired by resque-timeout and resque-retry.
License
The gem is available as open source under the terms of the MIT License.