You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
require "redis"
Resque.before_fork = Proc.new do |job|
ActiveRecord::Base.connection.disconnect!
end
Resque.after_fork = Proc.new do |job|
ActiveRecord::Base.establish_connection
end
The text was updated successfully, but these errors were encountered:
bituinb
changed the title
PG::ConnectionBad on activejob(resque adapter) after upgrading to rails Rails 5.2.0.beta2
PG::ConnectionBad on activejob(resque adapter) after upgrading to rails 5.2.0.beta2
Jan 23, 2018
FYI, you don't actually need those before/after fork blocks any more -- that's what that PR does -- but they certainly shouldn't break your application 😅, so this was a good catch.
Steps to reproduce
Expected behavior
Tell us what should happen
All jobs fails with PG::ConnectionBad exception
Actual behavior
Job fails with exception :
PG::ConnectionBad (connection is closed)
System configuration
Rails version: Rails 5.2.0.beta2
Ruby version: ruby 2.4.3p205
Pg gem version: pg-0.21.0
Resque config: 'config/resque.rb'
The text was updated successfully, but these errors were encountered: