1
mirror of https://github.com/rapid7/metasploit-framework synced 2024-11-12 11:52:01 +01:00

Fixes #1915. Only clear the connection pool if it exists

git-svn-id: file:///home/svn/framework3/trunk@9301 4d416f70-5f16-0410-b530-b9f4589650da
This commit is contained in:
HD Moore 2010-05-14 15:55:01 +00:00
parent f440317225
commit 10364dc70d

View File

@ -26,12 +26,12 @@ module DBSave
def self.included(mod)
class << mod
def find(*args)
ActiveRecord::Base.connection_pool.clear_stale_cached_connections!
ActiveRecord::Base.connection_pool.clear_stale_cached_connections! if ActiveRecord::Base.connection_pool
super(*args)
end
def save(*args)
ActiveRecord::Base.connection_pool.clear_stale_cached_connections!
ActiveRecord::Base.connection_pool.clear_stale_cached_connections! if ActiveRecord::Base.connection_pool
super(*args)
end