Skip to content
This repository has been archived by the owner. It is now read-only.

Commit

Permalink
Added Resque rake tasks to Railties.
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael van Rooijen committed Apr 12, 2011
1 parent acdaca7 commit 7bc539d
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
15 changes: 15 additions & 0 deletions lib/hirefire/railtie.rb
Expand Up @@ -15,5 +15,20 @@ class Railtie < Rails::Railtie
HireFire::Initializer.initialize!
end

##
# Adds additional rake tasks to the Ruby on Rails environment
#
# @note
# In order for Resque to run on Heroku, it must have the 'rake jobs:work'
# rake task since that's what Heroku uses to start workers. When using
# Ruby on Rails automatically add the necessary default rake task for the user
#
# @note
# Delayed Job already has 'rake jobs:work' built in.
#
rake_tasks do
require File.join(WORKERS_PATH, 'resque', 'tasks')
end

end
end
10 changes: 10 additions & 0 deletions lib/hirefire/workers/resque/tasks.rb
@@ -0,0 +1,10 @@
# encoding: utf-8

require 'resque/tasks'

task 'resque:setup' => :environment do
ENV['QUEUE'] ||= '*'
end

desc 'Alias for the rake task "resque:work", this is required for Heroku.'
task 'jobs:work' => 'resque:work'

0 comments on commit 7bc539d

Please sign in to comment.