Sha256: 9313f3cb5749f560b2fb106308a906c12db3aad5972b6a8a626c2e72c24861de
Contents?: true
Size: 715 Bytes
Versions: 12
Compression:
Stored size: 715 Bytes
Contents
require 'resque/pool/tasks' # this task will get called before resque:pool:setup # preload the rails environment in the pool master task "resque:setup" => :environment do # generic worker setup, e.g. Hoptoad for failed jobs end task "resque:pool:setup" do # close any sockets or files in pool master ActiveRecord::Base.connection.disconnect! # and re-open them in the resque worker parent Resque::Pool.after_prefork do |job| ActiveRecord::Base.establish_connection end # you could also re-open them in the resque worker child, using # Resque.after_fork, but that probably isn't necessary, and # Resque::Pool.after_prefork should be faster, since it won't run # for every single job. end
Version data entries
12 entries across 12 versions & 2 rubygems