Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions lib/tasks/resque.rake
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
require "resque/pool/tasks"

task "resque:setup" => :environment

task "resque:pool:setup" do
ActiveRecord::Base.connection_handler.clear_all_connections!

# The pool master boots Rails and then forks each worker, so hand every child
# its own Redis and database connections instead of sharing the master's.
Resque::Pool.after_prefork do
Resque.redis.reconnect
ActiveRecord::Base.establish_connection
end
end
Loading