Skip to content

Commit

Permalink
Sequel opens a db connection to set up models as they're loaded. This…
Browse files Browse the repository at this point in the history
… open connection was getting forked, and led to a cluster of workers attempting to make queries over the same socket.
  • Loading branch information
jdunphy authored and mattetti committed Dec 13, 2008
1 parent 58ba141 commit c37f8a6
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions merb_sequel/lib/merb_sequel.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,16 @@ def self.run

end

class Merb::Orms::Sequel::DisconnectBeforeFork < Merb::BootLoader
after AfterAppLoads

def self.run
Merb.logger.debug "Disconnecting database connection before forking."
::Sequel::DATABASES.each { |db| db.disconnect }
end

end

generators = File.join(File.dirname(__FILE__), 'generators')
Merb.add_generators generators / :migration
Merb.add_generators generators / :model
Expand Down

0 comments on commit c37f8a6

Please sign in to comment.